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

Need to Log DATE ONLY....use Datetime() ????

Status
Not open for further replies.

kev100

Programmer
Jun 20, 2006
28
US

I've been using:

end_date = Datetime()

To log the date only (it was returning 3/5/2007 only).

After a recent upgrade...the same command is now returning date AND time (as in "3/5/2007 12:34:15 PM")

Is there a variation of Datetime() that will return only the date....as in "3/5/2007" ?

Thanks very much.



 
Check documentation on DATE() to see if that will help you.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
DOH!

You're right.

I didn't ref docs...but did find it in some other coding.

For anyone referencing this.....

end_date = DTOC(Datetime())

....will return only the date.
 
But DTOC(Datetime()) will return character (or string) data type, not an actual date data type.

end_date = DATE() will make variable end_date a date type.


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top