Welcome! Log In Create A New Profile

Advanced

SQL dateTime field (WD21)

Posted by Niek 
Niek
SQL dateTime field (WD21)
July 30, 2020 05:12PM
Hi,

I'm busy to convert some data from HyperFile to MSSQL.
In HyperFile I have a 'datetime' field.
I did translate it as a DateTime field in MSSQL.

When i run a query (SELECT TOP 10 * FROM ORDERS) on the MSSQL server (Microsoft SQL Server Management Studio) datetime field is presented as:
2012-01-19 09:24:26.280

In another database stored on a other machine I can do
SELECT *
from Orders
where OrderDate='20120119'

and then i get the records.

On this database, on my local machine, i get nothing.

Why ?
Argus
Re: SQL dateTime field (WD21)
July 30, 2020 06:13PM
"2012-01-19 09:24:26.280" is NOT equal to '20120119', and the format has NOTHING to do with it...

One is a dateTIME, the other a date...
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: