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!

Dates

Status
Not open for further replies.

WJProctor

Programmer
Jun 20, 2003
151
0
0
GB
Hi, i need to store a date in my database, but i want it to be in the format "MM/YYYY", how can i do this. If possible i would like to save it as a date type and not a string.

Regards

James Proctor

 
Save it as a datetime and format it for presentation.
If you don't want the day then set it to 01

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
You can either store the date as a varchar in the format you want or store the full date in the date field and display it in the format you require when your produce output i.e
SELECT SUBSTRING(CONVERT(VARCHAR,getdate(),103), 4, 7)

Missy Ed - Project Manger - Bolton, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top