Hello Gurus
I need your help in building a query which will be used in VBA code.
I have a table in which I have two Datetime fields and two other fields like this
Season Time_slot Season_St_Dt Season_Fi_Dt
Summer Day 26/03/2017 09:00:00 28/10/2017 00:00:00
Summer Night 26/03/2017 00:00:01 28/10/2017 08:59:59
Winter Day 29/10/2017 08:00:00 25/03/2018 23:00:00
Winter Night 29/10/2017 23:00:01 25/03/2018 07:59:59
When user input a date & time like 23/08/2017 10:00:00 am , I need to pick a single row based on input date and time slot it falls in.
I have tried multiple combinations of datevalue(Season_St_Dt) and also tried Timevalue function too.
It appears Datevalue or search on date only works fine to give me two rows but when time comes into picture then it goes in pear shape. I know it will be tricky to see when date / time changes after mid night as timing are different for day and night in summer vs winter.
Any help will be greatly appreciated.
I need your help in building a query which will be used in VBA code.
I have a table in which I have two Datetime fields and two other fields like this
Season Time_slot Season_St_Dt Season_Fi_Dt
Summer Day 26/03/2017 09:00:00 28/10/2017 00:00:00
Summer Night 26/03/2017 00:00:01 28/10/2017 08:59:59
Winter Day 29/10/2017 08:00:00 25/03/2018 23:00:00
Winter Night 29/10/2017 23:00:01 25/03/2018 07:59:59
When user input a date & time like 23/08/2017 10:00:00 am , I need to pick a single row based on input date and time slot it falls in.
I have tried multiple combinations of datevalue(Season_St_Dt) and also tried Timevalue function too.
It appears Datevalue or search on date only works fine to give me two rows but when time comes into picture then it goes in pear shape. I know it will be tricky to see when date / time changes after mid night as timing are different for day and night in summer vs winter.
Any help will be greatly appreciated.