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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to turn a date into a timedate? 1

Status
Not open for further replies.

Oona8

Technical User
Apr 3, 2002
25
FR
Hi
I'm using CR8
I created a variable I named
@yesterday:

datevar yesterday;
yesterday := (currentdate-1)

I'd like to turn this variable into a Datetime variable that would give me yesterday's date AND time and the time should be 5pm all the time.
I tried various types of formulas, such as DTSToTimeString, or CTIME etc.. but none of them seems to work..

How could I do that?
 
Like this:

@yesterday:

WhilePrintingRecords;
DateTimeVar Yesterday;
Yesterday := DateTime(Year(CurrentDate),Month(CurrentDate),Day(CurrentDate),17,00,00);

All the best,

Naith
 
Thanks very much Naith, it works!

Oona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top