Date & Time Query
-
sexta-feira, 17 de agosto de 2012 00:08
Good Day All,
I have an ORDERS table.
The need is to look @ all orders placed for this year ( Between Jan 1, 2012 and Now() ).
But only between 8pm and 6:30am.
Any ideas on how I could write this?
Thanks for your assistance!
Nigel
Thanks! Nigel
Todas as Respostas
-
sexta-feira, 17 de agosto de 2012 00:17
It sounds like you need 2 conditions in your Query like:
SELECT ...
FROM [ORDERS]
WHERE ([OrderDate] Between DateSerial(Year(Date()), 1, 1) And Now())
AND ( (TimeValue([ORDERDATE]) >= #20:00#) Or (TimeValue([ORDERDATE]) <= #06:30#) )
If you don't have any future-dated orders, you can change the Between... condition to simpler Greater Than... condition.
Van T. Dinh
- Editado Van DinhMVP sexta-feira, 17 de agosto de 2012 00:18
- Sugerido como Resposta Tx_OfficeDev quarta-feira, 22 de agosto de 2012 06:04
- Marcado como Resposta Tom_Xu_WXModerator segunda-feira, 27 de agosto de 2012 07:06
-
segunda-feira, 20 de agosto de 2012 20:18
Will try it out this week & see if I can get that to work.
Thanks! Nigel
-
quarta-feira, 22 de agosto de 2012 06:04
Hi Nigel_143,
I think Van's reply is your goal's answer. Do you try it?
T.X.

