Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Date And Time With Seconds into Linked Sql Table i 1

Status
Not open for further replies.

PWise

Programmer
Dec 12, 2002
2,633
US
Database
MSAccess .mdb with linked Sql Server Backend.

Problem
Using this Syntax
Code:
mydb.Execute "insert into TimeClock (Empid,ClockTime,Status) values (" & Me.Empid & ",#" & Now() & "#," & Me.TimeStatus & ")"
inserts the to the ClockTime field in this format mm/dd/yyyy HH:MM:00.

I need it in this format mm/dd/yyyy HH:MM:SS.
 




Hi,

How about this...
Code:
mydb.Execute "insert into TimeClock (Empid,ClockTime,Status) values (" & Me.Empid & ",#" & [b]Format(Now(),"mm/dd/yyyy HH:NN:SS") & "#," & Me.TimeStatus & ")"

Skip,

[glasses] [red][/red]
[tongue]
 
Thank You Skip!

But Sorry still no Seconds.

Pwise
 
Thank You Remou!

But Sorry still no Seconds.

Pwise
 




What's the precision of the field that you are updating with Date/Time?

ONE SECOND is
[tt]
0.0000115741
[/tt]

Skip,

[glasses] [red][/red]
[tongue]
 
thanks Skip for putting me on the right track it was a sql server smalldatetime I changed it to a datetime which stores seconds.

Have A Star!

Pwise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top