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)
 uk date format

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-01 : 07:58:47
Steve writes "Hi I have an asp vb script page that returns values from a recordset that one field a date field can be upadted from a form field. The dates will need to entered in uk format as the users will not be able to cope in the american format. If I enter the date in a uk format dd/mm/yyyy sql 2000via iis5 complains saying out of range. I have combated displaying the usa format to display in uk format. Can this be done? your help would be very much appreciated."

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-07-01 : 08:24:55
search here for SET DATEFORMAT....this topic has come up many times....

you have to seperate 2 things....presentation layer v storage layer.

your asp page deals with the presentation, sql deals with the storage....

1. key is getting your storage part right....universal advice....save/work with dates in yyyymmdd format....absolutely no abmiguity about it's values then...and then stick with it across all date access.

while a date will be saved in SQL as 20020701....the SQL statement SELECT convert(varchar(12), Datefield1, 103) FROM table1 can return different 'looking' dates, depending on the date format in the style part of the function.

style = 103 will display 01/07/2002
style = 104 will display 01.07.2002
style = 110 will display 07/01/2002


2. validating what you key in, display in presentation layer...may involve querying registry/PC settings?



Go to Top of Page
   

- Advertisement -