If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
SQL Code Help
Hi,all Could someone help me out with some SQL code to resolve the following issue? I need to generate one piece of SQL code to be used by a report via a query in access 2003. Below is an example of three items of data that I need the query to use If Pa=a or Pa =b and AL = no information in field AND DU=0 then TF = “ No Data” then display result with ID If Pa=a or Pa =b and AL = has got information in field AND DU=0 then TF = “Data” then display result with ID If TR =”ComP” and DU=0 then display result with ID The query would need to ORDER BY fields RID, IDA in Ascending The table is called SLD Reference to TF is to a temporary reference (not part of the table) Reference to AL is to test this field in the table for the presents or not of data Reference to ID is the record Reference field Thank you |
#2
|
|||
|
|||
SQL Code Help
If TR =”ComP” and DU=0 then display result with ID
Display what? Maybe this -- SELECT ID, RID, IDA, IIF(TR =”ComP” and DU=0, "Data", IIF((Pa="a" OR Pa ="b") AND (AL = "" OR AL = Null) AND DU=0, “ No Data”, "Data”)) AS TF FROM SLD ORDER BY RID, IDA; -- Build a little, test a little. " wrote: Hi,all Could someone help me out with some SQL code to resolve the following issue? I need to generate one piece of SQL code to be used by a report via a query in access 2003. Below is an example of three items of data that I need the query to use If Pa=a or Pa =b and AL = no information in field AND DU=0 then TF = “ No Data” then display result with ID If Pa=a or Pa =b and AL = has got information in field AND DU=0 then TF = “Data” then display result with ID If TR =”ComP” and DU=0 then display result with ID The query would need to ORDER BY fields RID, IDA in Ascending The table is called SLD Reference to TF is to a temporary reference (not part of the table) Reference to AL is to test this field in the table for the presents or not of data Reference to ID is the record Reference field Thank you . |
#3
|
|||
|
|||
SQL Code Help
Thank you for pointing me in the right direction
|
Thread Tools | |
Display Modes | |
|
|