lpking2005
Board Regular
- Joined
- Mar 21, 2011
- Messages
- 140
Hi,
Im not sure if this belongs in Excel or Access forum section.
I have the following sql code which is working lovely but i need to modify it.
So obviously it looks at a table and retrieves only records that have a status of "Ordered" and places them one by one into an excel sheet.
But recently i had to change the table and add an 'Order Priority' column.
So every order entered into the database now has a priority number of 2 (low priority) but if the user adds a high priority order, the number will be 1.
What i need is to still select the orders that have the status 'Ordered' but also check to see if the 'Order Priority' number is set as 1 and select that first before moving onto records with a number 2 priority.
I hope this isnt confusing!?
Any help will be very much appreciated.
Im not sure if this belongs in Excel or Access forum section.
I have the following sql code which is working lovely but i need to modify it.
Code:
sSql = "SELECT * FROM " & i & " WHERE [Pick Status] = 'Ordered'"
So obviously it looks at a table and retrieves only records that have a status of "Ordered" and places them one by one into an excel sheet.
But recently i had to change the table and add an 'Order Priority' column.
So every order entered into the database now has a priority number of 2 (low priority) but if the user adds a high priority order, the number will be 1.
What i need is to still select the orders that have the status 'Ordered' but also check to see if the 'Order Priority' number is set as 1 and select that first before moving onto records with a number 2 priority.
I hope this isnt confusing!?
Any help will be very much appreciated.