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 |
|
Amber_Deslaurier
Starting Member
40 Posts |
Posted - 2010-05-29 : 14:04:45
|
| Hi!I have an existing query and I would like to add a new Column called WDate and to have "2010-05-29" added to every line that has output...is this correct?"2010-05-29" WDate,Thanks!Amber- |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-05-29 : 16:46:30
|
| Can you please elaborate more what exactly do you want?PBUH |
 |
|
|
jason_heckenkamp
Starting Member
1 Post |
Posted - 2010-05-29 : 19:05:38
|
| Hi Amber,Let's say your query looks like this:SELECTField1,Field2,Field3FROM MyTableWHERE 1=1You would do this to meet your needs:SELECTField1,Field2,Field3,'2010-05-29' AS WDateFROM MyTableWHERE 1=1Hope this helps.-Jason |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-31 : 03:55:22
|
| Also if you want to make it datetime, cast it to datetimecast('20100529' as datetime) AS WDateMadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-05-31 : 04:10:46
|
| ... and leave the hyphens out, as Madhi demonstrates. |
 |
|
|
Amber_Deslaurier
Starting Member
40 Posts |
Posted - 2010-06-17 : 22:29:21
|
| Thanks guys! |
 |
|
|
|
|
|