Hello!
Im having a problem with datetime and smalldatetime parameters. I need to insert a date in a smalldatetime field. The problem is that the date comes from the application in different formats depending on how the computer was set.
In this particular case I need to insert a date with hour and minute (13/04/2007 17:45) but on some computers the string returned is something like 13/04/2007 05:45 PM (so i get the error that says it could not convert the string to datetime). I need to insert the minutes like 17:45 so that when the user looks back to know that the action took place in the afternoon and not in the morning.
I think the general question would be: how to receive a valid parameter datetime or smalldatetime no matter the settings on the users computer?
If you have sugestions for resolving this using either .net code or sql (transact-sql) im all years (and eyes )
Thank you
Im having a problem with datetime and smalldatetime parameters. I need to insert a date in a smalldatetime field. The problem is that the date comes from the application in different formats depending on how the computer was set.
In this particular case I need to insert a date with hour and minute (13/04/2007 17:45) but on some computers the string returned is something like 13/04/2007 05:45 PM (so i get the error that says it could not convert the string to datetime). I need to insert the minutes like 17:45 so that when the user looks back to know that the action took place in the afternoon and not in the morning.
I think the general question would be: how to receive a valid parameter datetime or smalldatetime no matter the settings on the users computer?
If you have sugestions for resolving this using either .net code or sql (transact-sql) im all years (and eyes )
Thank you