Movian
05-18-2009, 09:04 AM
Hi,
i have a drop down with the following SQL query as its row source
"SELECT DISTINCT DX FROM Ledger;"
Now we have changed this a little and now have 4 distinct Dx Fields
Dx, DX2, DX3 & DX4
i need to restructure the SQL query so that it takes the distinct values from all 4 fields to produce the list for the drop down.
Let me give an example to better explain what i need
Record - DX - DX2 - DX3 - DX4
1 - 456 - 455 - Null - Null
2 - 455 - 123 - 456 - Null
i would need the drop down list to provide the following options.
456
455
123
i think i need to use a merge command. but im not exactly sure on the syntax. Any help would be appreciated.
~edit
If i can't do this through a SQL statement then i will need to produce a search routine using indexes to check if the DX allready exists and use a lookup table to store the results and then use somthing akin to the origional SQL statement to put the list into the drop down row source. Obviously this is not the best solution and i would prefere to do everything within the SQL statement as i should be able to.
i have a drop down with the following SQL query as its row source
"SELECT DISTINCT DX FROM Ledger;"
Now we have changed this a little and now have 4 distinct Dx Fields
Dx, DX2, DX3 & DX4
i need to restructure the SQL query so that it takes the distinct values from all 4 fields to produce the list for the drop down.
Let me give an example to better explain what i need
Record - DX - DX2 - DX3 - DX4
1 - 456 - 455 - Null - Null
2 - 455 - 123 - 456 - Null
i would need the drop down list to provide the following options.
456
455
123
i think i need to use a merge command. but im not exactly sure on the syntax. Any help would be appreciated.
~edit
If i can't do this through a SQL statement then i will need to produce a search routine using indexes to check if the DX allready exists and use a lookup table to store the results and then use somthing akin to the origional SQL statement to put the list into the drop down row source. Obviously this is not the best solution and i would prefere to do everything within the SQL statement as i should be able to.