var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Date/Time Access
I am trying to insert the correct date format into an access database using ASP (SQL)
I have searched the topics on the forum but don't answer my question.
I have set the Locale to Session.LCID = 2057 British Time/Date
I have used the SQL Statement
strSQL = strSQL & "'," & "#" & Now() & "#" & ")"
But it inserts the Date/Time in American format still.
How can I overcome this probelm?
Thanks in advance Gaz
I know more about Access than I do about ASP. Are you looking at the date in an Access table after it has been inserted? If so, Access stores date information the same way, there are a couple of things that affect the way it displays. One is the Format function, another is the Regional Settings of the OS (assuming it is Microsoft). You will probably need to use the Format function to get it to display the way you want. Ex.
That code did not work in ASP,
I tried a few work arounds but it still didn't work.
I managed to get around the problem as so,
strDate = Now()
strDate = Replace(strDate, " PM", "")
strDate = Replace(strDate, " AM", "")
The reason why it was not inserting the record was because Now() has PM or AM at the end the date.
I am having a strange problem now though,
the date is inserted into the record using
Session.LCID = 2057
And appears in the database in this format.
When I display the record the date appears in american format with PM/AM?
I inserted a record directly into the database and the format is correct?
But when viewing it, it does not show the PM/AM as the records that I inserted with the ASP/SQL does.
Swings and Roundabouts!
The key problem is that you are dealing with three different user profiles when you are doing this stuff...
One is the profile of the SQL user, it has it's own data time format setting...
Another is the profile for the IUSR account...
The last is the profile for the default user.
I wish I had a really good answer that would solve all your problems but I honestly haven't been able to find one.
What I tend to do is rebuild my dates into whatever format I want using month, day and year functions....