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

DateToStr question

Status
Not open for further replies.

Baldwin238

Technical User
Feb 23, 2005
68
0
0
US
I am looking for a way to convert today's date to a string in the following format: yyyymmdd without any delimiters such as "/" (yyyy/mm/dd). Can you use DateToStr or is there a better way to accomplish this?

Jeff Baldwin
sig2.gif
 
Roughly like this.
[tt]
'case 1
d=#2006/7/30#
dd=right("00"&day(d),2)
mm=right("00"&month(d),2)
yyyy=year(d)
'desired format
fd=yyyy&mm&dd

'case 2
s="7/30/2006"
d=cdate(s)
dd=right("00"&day(d),2)
mm=right("00"&month(d),2)
yyyy=year(d)
'desired format
fd=yyyy&mm&dd
'similarly for many similar cases
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top