Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date format
Message
From
29/12/2012 17:14:35
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
Date format
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01560885
Message ID:
01560885
Views:
60
In my code, before executing a script, I have this verification:
        ' If the date is not valid
        If Not oApp.EmptyDate(tdDate) And tdDate < New Date(1927, 1, 1) Then
            Return False
        End If
The script starts like this:
DECLARE @ModUser Int
DECLARE @ModDate DateTime
DECLARE @InspectionDate DateTime
DECLARE @Numero Int

SET @ModUser=1
SET @ModDate='2012-12-17 10:30:15'
SET @InspectionDate='1-01-01 00:00:00'
SET @Numero=60443
However, in the .NET code, the tdDate did not go into the condition. So, it saw it as ok. My condition is to make sure the date is not empty and smaller than 1927. But, when we look at the script, it says 1-01-01 00:00:00. So, is this possible SQL Server sees that as 2001?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform