473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

date and time problem

I have written asp code to insert current date and time.
my database is in sql server 2000.
this is the sql query that i m using.

sql = "INSERT INTO tblDailyVisitLog
(UserID,DailyDate,DailyTime) VALUES
('test',"&formatdatetime(date,2)&",'"&formatdateti me
(date,3)&"')"

But when I checked in the database in date and time field
it shows "1/1/1900" in both fields.

any help would be appreciated..
thanx.
david
Jul 19 '05 #1
2 1563

"dave" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
I have written asp code to insert current date and time.
my database is in sql server 2000.
this is the sql query that i m using.

sql = "INSERT INTO tblDailyVisitLog
(UserID,DailyDate,DailyTime) VALUES
('test',"&formatdatetime(date,2)&",'"&formatdateti me
(date,3)&"')"

But when I checked in the database in date and time field
it shows "1/1/1900" in both fields.


REsponse.write your SQL statement so you can see exactly what is being
executed against the database
Jul 19 '05 #2
CJM
What date format are you using? ie where are you based? US? UK? Other?

It's always a good idea to use ISO date formats, i.e. 2004-01-15 or
20040115.

http://support.microsoft.com/?kbid=229690
http://www.aspfaq.com/show.asp?id=2260

Chris

"dave" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
I have written asp code to insert current date and time.
my database is in sql server 2000.
this is the sql query that i m using.

sql = "INSERT INTO tblDailyVisitLog
(UserID,DailyDate,DailyTime) VALUES
('test',"&formatdatetime(date,2)&",'"&formatdateti me
(date,3)&"')"

But when I checked in the database in date and time field
it shows "1/1/1900" in both fields.

any help would be appreciated..
thanx.
david

Jul 19 '05 #3

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

Similar topics

3
by: Jay | last post by:
I previously posted this question under Visual Basic newsgroup, but was advised to re-post here. I'm hoping someone can help me solve an issue I'm having with VB.Net and Access 2000. Here's...
7
by: vnl | last post by:
I'm trying to run a SQL query but can't find any records when trying to select a certain date. Here's the sql: SELECT field 1, field2, date_and_time, FROM table1 WHERE date_and_time =...
1
by: Raghu | last post by:
Hello... I am running into a problem while running a query..can some1 help.. this is the query : ************** SELECT * from Table S where S.dtDate1 BETWEEN...
18
by: Robin Lawrie | last post by:
Hi again, another problem! I've moved from an Access database to SQL server and am now having trouble inserting dates and times into seperate fields. I'm using ASP and the code below to get the...
2
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
6
by: Geoff Cox | last post by:
Hello, at the moment I can add the combined date and time into MySQL using php $dt1 = date("Y-m-d H:i:s"); is it possible to add the date and time separately? I thought it might be
10
by: WebCM | last post by:
There is a function: http://paste.ubuntu.com/21865 It needs GMT date in YYYY-MM-DD HH:MM:SS format - in SQL: datetime. If date is the same as today, the function returns "Today". There is one...
16
by: W. eWatson | last post by:
Are there some date and time comparison functions that would compare, say, Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd) Is 02/11/07 the same as 02/11/07? Is 14:05:18 after...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.