UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Help With Datediff Function, Access 2016    
 
   
sroot
post Sep 19 2018, 07:25 AM
Post#1



Posts: 60
Joined: 26-September 12



Good morning.

I have a query that is uses the datediff function. It works just fine but the problem is that the users need to change the date manually for them every day. I know there is a way to do it without having to change the date, i just can't seem to figure it out. The one is always for today's date and the other is always for tomorrow. I know i can use date() but the problem with that is i need to know the hours from 6:00 AM. i cant seem to figure out how to combine Date() and 6:00 AM. This is what i use now.

CODE
DateDiff("h",[rcv_hdr]![rcv_dt],(#9/19/2018 6:00:00 AM#))


CODE
DateDiff("h",[rcv_hdr]![rcv_dt],(#9/20/2018 6:00:00 AM#))
Go to the top of the page
 
DanielPineault
post Sep 19 2018, 07:36 AM
Post#2


UtterAccess VIP
Posts: 6,120
Joined: 30-June 11



What about

CODE
Date() + TimeSerial(6,0,0)




--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
sroot
post Sep 19 2018, 07:41 AM
Post#3



Posts: 60
Joined: 26-September 12



You are my hero! thanks. i tried that but i used & instead of +... ugh thanks so much!
Go to the top of the page
 
DanielPineault
post Sep 19 2018, 11:24 AM
Post#4


UtterAccess VIP
Posts: 6,120
Joined: 30-June 11



My pleasure! thumbup.gif

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th October 2018 - 10:19 PM