Link to home
Start Free TrialLog in
Avatar of emc_
emc_

asked on

ms sql query string syntax for formatting date functions?

hello!

I am looking for a way, to transform the date format in the database into a unix timestamp while querying. In the database, the format is DD.MM.YY and I am looking for a function similar to "UNIX_TIMESTAMP()" in MySQL in MS SQL. Is there something like that?

Thanks for any help!

regards,
Christoph
Avatar of xenon_je
xenon_je

Can you explain what UNIX_TIMESTAMP() does in MySQL?
IN MSSQL there is the timestamp datatype, read about it, maybe is what you need.
gl
ASKER CERTIFIED SOLUTION
Avatar of EugeneZ
EugeneZ
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of emc_

ASKER

ok, i tried your string, Eugene, which works fine. but how can i put in a column content? i tried this:

"select taskID, userID, datediff(ss,'1970-01-01 02:00:00.000','taskDate') from tblTasks;"

but it doesn't work. do you know why? thanks for hints!


regards,
christoph
select taskID, userID, datediff(ss,'1970-01-01 02:00:00.000',taskDate) from tblTasks;"