
October 4th, 2003, 05:53 AM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
sql server & dates
Hi,
I am having problems with dates and timestamps...
I have a textbox that allows the user to enter a date - the format is ccyymmdd. I have validation on this to ensure it is in the correct format.
I pass this as a parameter to a sql server stored procedure. In the stored procedure that parameter is defined as datetime and the field in the database is also datetime.
To cut a long story short...an exception is being thrown! I have convinced myself it is due to the date - everything else I have used before. I am not sure whether I need to do a conversion in SQL perhaps prior to insert but not sure how to do this in any case, or, whether I have to do something in the vb code before loading the parameter??
CREATE PROCEDURE [dateexample]
(@SomeDate [datetime])
AS INSERT INTO [testdate]
([SomeDate])
VALUES
(@SomeDate)
GO
Anyone had similar problems / suggestions ? If this is not posted in an appropriate forum I apologise like I say I'm not sure which side the solution lies...
Thanks to all who take the time to read this 
|