Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Need help: Session.LCID in ASP page causing database date/..

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Related Topics:
.htaccess causing unwanted 403 error - I have been using .htaccess to prevent of images from my site and it works well. However, I am switching to a new host (a dedicated server) and when I upload the file in the httpdocs directory (named /html) I get a 403 error trying to access..

[OT] What happened on this date in... - What happened on this date in... 1492?

date ORDER BY - Hi, I'm currently running a sql select statement on a date field which is ordered by the date field in ascending order. It worked fine for the 1st to the 9th of the month but when it output 10th, 11th, 12th etc. it put them before the 1st. So I was..

Date/Time on Sites - Hi, can someone please advise where I can find out how to get an applet or something that can put the time and date on my site. Thanks

sorting recordset by date - SELECT * FROM for_sale ORDER BY ListDate Desc I want to limit it to last 7 days. How would the SQL be written for Access?
Next:  Webmaster: Buying an expired and currently active domain name - advic..  
Author Message
Auggie

External


Since: Sep 06, 2005
Posts: 114



(Msg. 1) Posted: Thu Dec 15, 2005 12:55 pm
Post subject: Need help: Session.LCID in ASP page causing database date/time issue
Archived from groups: alt>www>webmaster (more info?)

Hi!

Having a problem on an ASP page when its inserting information into a MS SQL
2000 database...

In my shopping cart I have 3 columns:
"datecreated" this is smalldatetime and records the date the shopping cart
was created
"datesent" this is smalldatetime and records the date the order was actually
sent
"ordersent" this is a bit and flags whether or not the order has been sent
or not

These columns are mainly used for maintenance/upkeep or to allow the
customer to recall past orders... when a cart is created "datecreated" is
set with the current time/date... when the order is sent "datesent" is set
with the current time/date and "ordersent" is set to TRUE (1)

At the end of the day when maintenance scripts run all carts that were
created more than 24hrs ago and not sent are deleted and all carts that are
created more than 30 days ago that were sent are moved to the archived
orders database...

This is done because carts that are more than 24hrs old are pretty much
useless and archived orders are kept in the event a customer wants to come
back and say "what did I order in the past" or "I want to resend a past
order" and they will see orders from the last 30 days... if they want to go
back further then the archive database is accessed for old orders...

The problem:

Everything works fine for restaurants in the US, but we're doing the rollout
ot the UK now and thats causing some problems...

To handle the different date format and the GBP symbol I have set the
"SESSION.LCID=2057" in all web pages.

Things worked fine when we started setting up restaurants back on December
1st and running tests... but as soon as we hit Tuesday this week (December
13th) problems started coming up.

The problem is under the US LCID dates are written as: MM/DD/YYYY... but
under the UK LCID dates are written as: DD/MM/YYYY and so though it looked
like things were working, as soon as we hit December 13th we hit the problem
where there is no 13th month so SQL errors started coming up as "can't
convert CHAR format to SMALLDATETIME"

I took a look around SQL and can't seem to find anything where I can set the
date/time format on the one database to use a different date/time format...
and I don't want to set the SESSION.LCID back to US before each write that
involved a date and then back to UK once its done (it'd probably work, but
seems like it would be an innefficient way of doing things)... and I don't
want to convert the dates in the DB columns to CHAR format because that
might bugger up the date/time sorting.

So looking to see if there are any suggestions out there.. I Googled for
ideas, but didn't really come up with anything

Thanks!

Clint

 >> Stay informed about: Need help: Session.LCID in ASP page causing database date/.. 
Back to top
Login to vote
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 2) Posted: Thu Dec 15, 2005 1:55 pm
Post subject: Re: Need help: Session.LCID in ASP page causing database date/time issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Writing in news:alt.www.webmaster
From the safety of the cafeteria
Auggie <Imperial.Palace.TakeThisOut@Rome.It> said:

> Hi!

How do you do?

> Having a problem on an ASP page when its inserting information into a MS
> SQL
> 2000 database...
> ...
> The problem is under the US LCID dates are written as: MM/DD/YYYY...
> but
> under the UK LCID dates are written as: DD/MM/YYYY ...

I'd guess you're setting the dates in ASP. Have you considered letting
SQL Server create them?

--
William Tasso

Save the drama
for your Mama.

 >> Stay informed about: Need help: Session.LCID in ASP page causing database date/.. 
Back to top
Login to vote
nospam39

External


Since: Nov 09, 2003
Posts: 131



(Msg. 3) Posted: Thu Dec 15, 2005 6:55 pm
Post subject: Re: Need help: Session.LCID in ASP page causing database date/time issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Auggie" <Imperial.Palace RemoveThis @Rome.It> wrote in message
news:s8hof.146950$y_1.72237@edtnps89...

I used to have numerous problems with dates in SQL server not marrying up
properly with front end applications - mainly Access and Visual Basic. I now
store all dates in International Date format (YYYY-MM-DD) and never have a
problem - means a little bit of extra work on formatting at the front end
but I think that's a better place to handle it, rather than running the risk
of inconsistent records in the database itself.
 >> Stay informed about: Need help: Session.LCID in ASP page causing database date/.. 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]