Click to See Complete Forum and Search --> : CDate and DataPart problems


Bartus
09-02-2003, 08:33 AM
Hello !!!

I have problems with CDate and DataParts.
I need to separate day, month and year from date.

Format of my date it dd-MM-yyyy

doba=request.QueryString("data")
(ex. 01-09-2003, 01-day, 09-month)
doba=CDATE(data)
year=datepart("yyyy",(doba))
month=datepart("m",doba)
day=datepart("d",(doba))
And the problem is that I recived day=09, month=01 ?

How to make CDATE works with dd-MM-yyyy format ?

Ribeyed
10-04-2003, 06:15 AM
HI,
basically all you have to do is covert your date into the standard YYYYMMDD format and it will work. Here is an artical you can reffer to for the syntax.

http://www.aspfaq.com/show.asp?id=2040