Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TimeValue Function

Status
Not open for further replies.

pkohli88

Programmer
Oct 25, 2006
30
US
Hi,
I have field that includes date and time , If i want to select records for previous 12 hrs. what will be the records selection formula. Using CR 10 version

Thanks
 
Hi,
I have got the solution as follows

Code:
if currenttime >= time(12,00,00)
then
{TBL_PMNS_SC_PROBLEM.OPEN_DT} >= datetime(currentdate ,currenttime-43200)
else
{TBL_PMNS_SC_PROBLEM.OPEN_DT} >= DateTime (CURRENTDATE-1,CURRENTTIME-43200)

but is there a direct way to subtract 12 hours from datetime function.

Thanks

 
Try:

For your record selection try:

{table.datetime} in dateadd("h",-12,currentdatetime) to currentdatetime

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top