I have two field in database one for date and other for Time.I want to save data in 3rd field. My office timing is 04:00 PM to 03:00 AM. Suppose that today is 30th Nov, when i save data between 04:00 PM to 11:59 PM it will save in 30th nov but if i save after 12:00 am then it takes next date. My question is how can i save that data in same day i.e. 30 Nov.
Time and date Fixing
Collapse
X
-
Tags: None
-
My query is: suppose today is 30 nov, if I save date in database before 11:59 PM it will save as 30th Nov but after 11:59 it save as next date. My office timing is 04:00 PM to 04:00 AM. So tell me how can i save date in between these timing.Comment
-
Its something similar too, but in queries we use IIF function
This bit of function first check the if the hour contained in <date> is over 3 or not, which means the time between 12AM to 3AM. If it is true, then use DateAdd to take one day back (taking Dec 01 back to Nov 30). Otherwise it remains as what it is.Code:IIF(Hour(<date>)MOD 24 >= 3, DateAdd("d",-1,<date>),<date>)
Also, can you post your query of what you've done so far?Comment
-
I have textbox on form. I want to input only numbers(0-9) and (.) from user. and if user input except these then cursor can't go to next object. if Textbox is blank then Tab works to goto next object. So please help meComment
Comment