Storing the date and time in a datetime field

Storing the date and time in a datetime field

Post by Paul Baue » Fri, 22 Feb 2002 04:07:09



It seems that seconds are not being stored in the datetime field. The
seconds always appear as 00. Am I missing something? If I pass the result of
the now() function to a textbox in my pocketpc2002 app I get seconds. When I
pass the now() value into the sqlce datetime filed in my database the
seconds are not saved. Any suggestions? Thanks for you help.

Paul Bauer

 
 
 

Storing the date and time in a datetime field

Post by Paul Baue » Fri, 22 Feb 2002 04:14:23


Sorry. My mistake. The database on the handheld is holding seconds values.

Paul


It seems that seconds are not being stored in the datetime field. The
seconds always appear as 00. Am I missing something? If I pass the result of
the now() function to a textbox in my pocketpc2002 app I get seconds. When I
pass the now() value into the sqlce datetime filed in my database the
seconds are not saved. Any suggestions? Thanks for you help.

Paul Bauer


 
 
 

1. Query datetime-field by date when field contains date + time

I have tablefield (sqlserver2000) which datatype is datetime. I have
inserted value "insert into ... datetimefield = {ts '2001-11-24
08:24:12'}..." in it. How can I find (query) that row by date ?

I have tried :
... where datetimefield like {d '2001-11-24'}...
... where datetimefield = {d '2001-11-24'}...
... where datetimefield like {d '2001-11-24%'}...
... where datetimefield like {d '%2001-11-24%'}...

..but query never returns that row. Whats wrong ?!?!

This works :
... where datetimefield = {ts '2001-11-24 08:24:12'}...
but time is unknown in "real life".

Connectionstring  is like:
"Provider=SQLOLEDB;Data Source=SERVERNAME;Initial
Catalog=tempdbase;User Id=sa;Password="

And same problem in  access database ?
... where datetimefield = #11/24/2001#...
... where datetimefield like #11/24/2001#...

Maybe its better to use string-datatype instead datetime...

Jaska

2. installing oracle 8.0.6 on sun solaris ES250

3. ADO with Access Date/Time field not storing the time, just the date

4. Raw partitioned disk HP/UX pros/cons?

5. Comparing datetime field (containing date, time values) to a date only string

6. GA - Atlanta - Informix Developer/Analyst To $60k HP-UX V10.0

7. Concatenating datetime field and int field to make a date time

8. stored procedure problem

9. Treating datetime fields as separate date and time fields

10. Current date and time as the Default Value for a DateTime Field

11. java.sql.Date producing a time element when passed to SQL Server datetime field

12. how do I separately retrieve the time and date from a datetime field

13. Time Without the Date in datetime field