473,671 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help on ASP SQL date format problem

Dear Friends,

I have a rather strange problem which invloves SQL server and ASP. The
problem is this.
I have an ASP application which use a SQL server. it saves date values
with MM/dd/yyyy format. the SQL server and every other computer is
configured to MM/dd/yyyy format in reginol settings. The DSN which use
to connect to SQL server is configured to use Reginol settings date
format.
But I for ex. when I save date 03/01/2006 (MM/dd/yyyy) using the
computer which runs sql server it saves right. But when I use other
computer it saves as 01/03/2006.
I'm really stuck in this mess. Please help me on this. Thank you.
Mewan
Sri Lanka

Mar 22 '06 #1
7 4275
wrote on 22 mrt 2006 in microsoft.publi c.inetserver.as p.general:
I have a rather strange problem which invloves SQL server and ASP. The
problem is this.
I have an ASP application which use a SQL server. it saves date values
with MM/dd/yyyy format. the SQL server and every other computer is
configured to MM/dd/yyyy format in reginol settings. The DSN which use
to connect to SQL server is configured to use Reginol settings date
format.
But I for ex. when I save date 03/01/2006 (MM/dd/yyyy) using the
computer which runs sql server it saves right. But when I use other
computer it saves as 01/03/2006.


No,No,no.

Dates saved in most databases in a date/time field are saved in an internal
numeric structure.

The only dependable date-litteral input to an sql string is #yyyy/mm/dd#
and the databse output should be put in a date variable where the
serverside script can extract d, m and y from.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 22 '06 #2
Dear Evertjan,
Thanks for your quick reply.

Thw thing is I don't specify any date format when i'm saving or editing
data. And the other thing is I simply enter the date in a asp text box
in MM/dd/yyyy format. do i have to type it in yyyy/mm/dd format. Thank
you.

Mewan

Mar 22 '06 #3
Dear Evertjan,
Thanks for your quick reply.

Thw thing is I don't specify any date format when i'm saving or editing
data. And the other thing is I simply enter the date in a asp text box
in MM/dd/yyyy format. do i have to type it in yyyy/mm/dd format. Thank
you.

Mewan

Mar 22 '06 #4
me********@hotm ail.com wrote:
Dear Evertjan,
Thanks for your quick reply.

Thw thing is I don't specify any date format when i'm saving or
editing data. And the other thing is I simply enter the date in a asp
text box in MM/dd/yyyy format. do i have to type it in yyyy/mm/dd
format. Thank you.

http://www.aspfaq.com/show.asp?id=2313
http://www.aspfaq.com/show.asp?id=2040
http://www.aspfaq.com/show.asp?id=2260

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Mar 22 '06 #5
wrote on 22 mrt 2006 in microsoft.publi c.inetserver.as p.general:
Thw thing is I don't specify any date format when i'm saving or editing
data.
That is what I said, databases do NOT store data in a readable format.
And the other thing is I simply enter the date in a asp text box
Asp text boxes do not exist, as ASP is serverside only.

Maybe in asp.net, but if that is what you mean
you are posting in the wrong NG.
This is a classic ASP only NG.
in MM/dd/yyyy format. do i have to type it in yyyy/mm/dd format.


No, you are the programmer, and between the form-posting and the entry in
the database, you put your own conversion code.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 22 '06 #6
Hi,

Thank you very much for your responces. What I mean by text box is the
basic asp form text box. anyway i followed ur advice and now i'm
entering the date as yyyy/mm/dd format. I don't do any formating in
between. so now the problem is solved. Thank you very much.

Mewan
Evertjan. wrote:
wrote on 22 mrt 2006 in microsoft.publi c.inetserver.as p.general:
Thw thing is I don't specify any date format when i'm saving or editing
data.


That is what I said, databases do NOT store data in a readable format.
And the other thing is I simply enter the date in a asp text box


Asp text boxes do not exist, as ASP is serverside only.

Maybe in asp.net, but if that is what you mean
you are posting in the wrong NG.
This is a classic ASP only NG.
in MM/dd/yyyy format. do i have to type it in yyyy/mm/dd format.


No, you are the programmer, and between the form-posting and the entry in
the database, you put your own conversion code.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Mar 24 '06 #7
wrote on 24 mrt 2006 in microsoft.publi c.inetserver.as p.general:
Evertjan. wrote:
wrote on 22 mrt 2006 in microsoft.publi c.inetserver.as p.general:
> Thw thing is I don't specify any date format when i'm saving or
> editing data.
That is what I said, databases do NOT store data in a readable
format.
> And the other thing is I simply enter the date in a asp text box


Asp text boxes do not exist, as ASP is serverside only.

Maybe in asp.net, but if that is what you mean
you are posting in the wrong NG.
This is a classic ASP only NG.
> in MM/dd/yyyy format. do i have to type it in yyyy/mm/dd format.


No, you are the programmer, and between the form-posting and the
entry in the database, you put your own conversion code.

Thank you very much for your responces. What I mean by text box is the
basic asp form text box. anyway i followed ur advice and now i'm
entering the date as yyyy/mm/dd format. I don't do any formating in
between. so now the problem is solved. Thank you very much.


[please do not toppost on usenet]

Mewan, basic ASP, classic ASP has no "asp form text box"es

So you are talking ASP.NET ????

I will answer for the classic ASP, that is the topic of this NG.

My idea is, that some form of checking between a submitted
form-input-text box content and the insertion of theat into a serverside
database is required.

On an open internet, the risk of injection has to be delt with, and if
the form is only available to yourself, you still have to make it as
easy as possible to avoid common mistakes.

an European (d)d-(m)m-yyyy input can be converted by (ASP-vbs):

insertdate(requ est.form("d"))

function insertdate(theF ormValue)
'' injection defence here
d = split(theFormVa lue,"-")
if ubound(d)<>3 then return
d2 = "#"&d(2)&"/"&d(1)&"/"&d(0)&"#"
''' etc '''
end function

American (m)m-(d)d-yyyy will need:
d2 = "#"&d(2)&"/"&d(0)&"/"&d(1)&"#"
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 24 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3207
by: Eric Linders | last post by:
Hello, Today is Thursday, August 18, 2004. I would like to have a variable that stores the date this coming Sunday (even if today happened to be Sunday) in YYY-MM-DD format. I also need a variable that will store the date this past Monday (even if today happens to be Monday) also in YYY-MM-DD format. So, the end result is that, for this week (today is 2004-08-18) I would have the following two variables:
4
2211
by: Nitin | last post by:
Hi I have created function to check date and time. at the time of execution, if date is left empty the function returns the error message but then the focus goes to next field. Next filed is for time and there is also a check on that. If time is empty return error message. Again the explorer returns error message and then shifts the focus to date field, again error message and focus goes to time and this story goes on and on, untill...
2
1509
by: Paul T. Rong | last post by:
I format the ShipDate to Format(, "Short Date") in a query, that is alright, the problem is that no matter I choose ascend or descend, I just cannot make the ShipDate in any order, it is for example like this: 15.09.2003 05.10.2004 15.10.2004 15.09.2004 .....
3
11578
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not overlap existing records from the same table. I had this all working some time ago, but recently when I have gone back to do more testing, part of these validations no longer work. While there have been changes to the code in the meantime, I cannot...
1
3580
by: Bernard | last post by:
Hello, Can someone please help me? We have developed a asp.net application which is working fine on 4 other computers. We have recently deplyed the application to the live environment running windows 2000 service pack 4, .NET v1.1.
6
4986
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
22
2178
by: KitKat | last post by:
I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7, and Cam 8. Well it does that but it also needs to change the file name to the same folder where the file is being grabbed, BUT it doesn't. I have tried and tried.....please help example: C:\Projects\Darryl\Queue Review Files\2-24\Cam 7\Cam7-20060224170000-01.jpg Cam7 but all I keep getting is Cam1, as the beginning of the jpg name,...:( HELP!
2
2078
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database using data imported from an Excel file and the person entering into Excel only cared about the month and day portion and Excel added the current year to the field value. I want to produce a report that shows upcoming anniversaries using a parameter...
9
3939
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result - I have read every post out there and spent hours trying to figure out the problem with no success whatsoever - I have constrained the problem to one form however, and I think it's hiding somewhere in my code associated with this form, which is...
8
2897
by: saladinator | last post by:
I have created an Excel spreadsheet that has a lot of data. What I want to do is import the spreedsheet to Access and create a form so that I can print each row per page in a proffessional manner. The problem is that whenever I import the data to access my dates show up in 38478 instead of 05/06/05. How can I convert this number back to the date format in access?
0
8481
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8400
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8823
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7441
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6234
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.