December 20, 2006 at 3:53 pm
I am using VB.NET 2005 and want to send Select commands to a SQLServer2005, for instance
Select * from Customers where OrderDate > ....
... is to be 4th Feb 2005 and is contained in a string variable in iso format (yyyy/mm/dd)
How is it to be dealt with?
thx
December 20, 2006 at 6:14 pm
I think the function name is: DATE
MohammedU
Microsoft SQL Server MVP
December 22, 2006 at 2:21 pm
thanks, but it didn't work as expected
any other suggestion, please?
thx
December 23, 2006 at 10:19 pm
You can have your app convert the format to mm/dd/yyyy and then convert the date pulled in by your query to that format..
CREATE PROCEDURE ap_getInfo
@importedDate datetime
AS
SELECT CONVERT (varchar, [dateColumn], 101) [Date Column]
FROM myTable
WHERE [Date Column] = CONVERT(varchar, @importedDate, 101)
GO
This link has a list of the various styles that can go in place of style 101 that I used in the above query. See the list here: http://sqljunkies.com/Article/6676BEAE-1967-402D-9578-9A1C7FD826E5.scuk
Hope that info helps!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply