Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dpcamp
Starting Member
10 Posts |
Posted - 2009-07-17 : 12:22:14
|
This seems like an easy one but i can't seem to find the right query anywhere for what i want to do.I have a small table with a date in decimal format Select CV_ID from TBLConfiguratorVersion returns 6.04.09how do i set up the query to return it as60409thanks |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-17 : 12:27:24
|
replace(CV_ID, '.', '') KH[spoiler]Time is always against us[/spoiler] |
|
|
dpcamp
Starting Member
10 Posts |
Posted - 2009-07-17 : 12:45:53
|
Sorry i keep getting errors when i try to run it, how am i supposed to place that into the existing query? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-17 : 12:46:50
|
[code]Select replace(CV_ID, '.', '') from TBLConfiguratorVersion[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
dpcamp
Starting Member
10 Posts |
Posted - 2009-07-17 : 12:53:43
|
thats what i did, didn't work the first few times for some reason. probably a typo... thanks |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2009-07-19 : 20:14:09
|
Ugh!... That also means that the date is stored as a VARCHAR. That would be the first thing to repair.--Jeff Moden "Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! ""RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-07-20 : 04:24:36
|
quote: Originally posted by dpcamp This seems like an easy one but i can't seem to find the right query anywhere for what i want to do.I have a small table with a date in decimal format Select CV_ID from TBLConfiguratorVersion returns 6.04.09how do i set up the query to return it as60409thanks
You should always use proper Datetime datatype to store dates and let the front end application do the formation. If you can't change the datatype, try using new column with datetime datatype;update values on that and use that column furtherMadhivananFailing to plan is Planning to fail |
|
|
|
|
|