Lin Ma wrote:
In my asp page, I have a date value from SQL database and I would
like to be formatted like: yyyy,mm,dd.
Such as 1/22/2005 to be 2005,1,22
That is not an example of yyyy,mm,dd format, as you are suppressing leading
zeroes.
Is there a simple command I can use?
If you *really* want yyyy,mm,dd format, then you could let SQL do it, for
one thing. Using date format 102, you can force the output into yyyy.mm.dd,
then replace '.' with ',':
SELECT REPLACE(CONVERT(CHAR(10),GETDATE(),102),'.',',')
http://msdn.microsoft.com/library/en...ca-co_2f3o.asp http://msdn.microsoft.com/library/en...ra-rz_76lh.asp
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.