This is a discussion on "ASP - MSSQL date format problem" within the Classic ASP section. This forum, and the thread "ASP - MSSQL date format problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
ASP - MSSQL date format problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
ASP - MSSQL date format problem
Hi
I’m new to MS-SQL and I’m having a problem with an ASP3 JS website that I’m upgrading from Access. I’m trying to format the date from mm/dd/yyyy as held in the db by GETDATE to display as dd/mm/yyyy on a web page. Previously with the Access db I used - "SELECT format(addate, 'dd/mm/yyyy') as addate1 FROM...” What do you use with MS-SQL??? Any help greatly appreciated as this is driving me nuts!!! |
|
|
|
|||
|
Re: ASP - MSSQL date format problem
|
|
|||
|
Re: ASP - MSSQL date format problem
If you wanted to format the date through ASP you can do that using the 'Format' function. However just like above I cannot remember the exact syntax so google is your best bet for that.
Tim Web Design |
|
|||
|
Re: ASP - MSSQL date format problem
Quote:
|
|
|||
|
Re: ASP - MSSQL date format problem
you could try adding to the first line of your query:
SET DATEFORMAT DMY; This will force the date as dd/mm/yyyy Might be of help! |
![]() |
| Tags |
| asp, mssql, date, format, problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| JS date format | joe3dge | JavaScript Forum | 0 | May 21st, 2007 00:11 |
| Changing date format in date picker | AdRock | JavaScript Forum | 1 | Aug 1st, 2006 17:16 |
| Date/Time format & multiple selection with listbox problem | frmsasp | ASP.NET Forum | 0 | Oct 12th, 2005 10:29 |
| date format help please | charter | Databases | 3 | Jun 14th, 2004 20:09 |
| Date Format | ekendricks | Classic ASP | 3 | Sep 1st, 2003 17:03 |