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!

Date Format 1

Status
Not open for further replies.

craigward

Programmer
Nov 13, 2007
230
GB
Hi,

I have a date that i need to format like yyyy/mm/dd but i can't find anything of that on the internet. currently the code below does what i need and takes today's date and adds 1 month to it. Problem is SQL does'nt like the format so i need to change the result from dd/mm/yyyy to yyyy/mm/dd

Any ideas on doing that? Thanks in advance.

Code:
dateplusmonth = DateAdd("m",1,date())
 
You may use this:
Year(dateplusmonth) & "-" & Month(dateplusmonth) & "-" & Day(dateplusmonth)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top