-
Date & time problems
Hi All,
I'm passing a string representing a number of records to a stored proc. Part of the string are 2 datetime columns. In the stored proc I break-up the string and place into temp vars before updating a number of tables with the values from the vars.
What's strange is the time part of the datetime column change when they are converted back to a datetime field. For example the following is the value orignially from the table:
30/01/2006 13:07:38
after being reconctructed backinto a date field it shows as:
30/01/2006 13:10:04
Another example: 28/02/2006 14:15:14 becomes 28/02/2006 14:15:44
Part of the function I created to do the conversion is below:
.....
--create date string
set @dtePart = @yearNo + '/' + @monthNo + '/' + @dayNo
set @timePart = @hour + ':' + @minutes + ':' + @seconds
--return date object
Return (cast(@dtePart +' '+@timePart as datetime))
Any clues to why this happens?
Thanks in advance for any help!
regards
Davej
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|