Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ASP US Date format

Author  Topic 

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-04-16 : 02:35:23
Greetings orl

Just had my server swapped from underneath me and have the ubiquitous US date format problem.

my query is
select convert(datetime, weeekending, 112) as wk
from tTIME


which returns "2002-04-06 00:00:00.000" in QA

my asp is
mperiod = CDate(rst.Fields("wk"))
response.write month(mperiod)

which returns 4 (as it should) on the old server and 6 on the new server!

Any clues?

PS regional settings on the new server are identical to that on the old server - "dd/mm/yyyy"

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

Edited by - rrb on 04/16/2002 02:39:00

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-04-16 : 02:50:03
Oops - just worked it out...it was the encode function

My code was actually
mperiod = CDate(Encode(rst.Fields("wk")) )
response.write month(mperiod)

instead of
mperiod = Encode(CDate(rst.Fields("wk")) )
response.write month(mperiod)

arrcgh

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -