-
Datetime field conversion
Hello, I would appreciate any suggestions
I've got a datetime field that I'd like to store as just the date without the time component, but still to keep it defined as a datetime field. I ran this update statement but this conversion isn't working. Conversion to char gives me what I want but I need to keep the field as a date datatype if possible.
Thanks
update
<table>
set
<column>=convert(datetime,convert(char(10),hire_da te,101)))
-
Datetime field conversion (reply)
Concatenate 3 datepart functions and a fixed '00:00:00.000' expression.
------------
Irene at 8/8/00 12:03:23 PM
Hello, I would appreciate any suggestions
I've got a datetime field that I'd like to store as just the date without the time component, but still to keep it defined as a datetime field. I ran this update statement but this conversion isn't working. Conversion to char gives me what I want but I need to keep the field as a date datatype if possible.
Thanks
update
<table>
set
<column>=convert(datetime,convert(char(10),hire_da te,101)))
-
Datetime field conversion (reply)
Try this one:
left(getdate(), 11)
------------
Irene at 8/8/00 12:03:23 PM
Hello, I would appreciate any suggestions
I've got a datetime field that I'd like to store as just the date without the time component, but still to keep it defined as a datetime field. I ran this update statement but this conversion isn't working. Conversion to char gives me what I want but I need to keep the field as a date datatype if possible.
Thanks
update
<table>
set
<column>=convert(datetime,convert(char(10),hire_da te,101)))
-
Datetime field conversion (reply)
Hi,
This should work.
convert(char(8), getdate(),1)
If you convert this value back to date,
you will see that the time is set to all zeros.
fred.
------------
Colin Y at 8/15/00 7:00:46 PM
Try this one:
left(getdate(), 11)
------------
Irene at 8/8/00 12:03:23 PM
Hello, I would appreciate any suggestions
I've got a datetime field that I'd like to store as just the date without the time component, but still to keep it defined as a datetime field. I ran this update statement but this conversion isn't working. Conversion to char gives me what I want but I need to keep the field as a date datatype if possible.
Thanks
update
<table>
set
<column>=convert(datetime,convert(char(10),hire_da te,101)))
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
|
|