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 |
|
Villanuev
Constraint Violating Yak Guru
478 Posts |
Posted - 2011-09-12 : 22:23:36
|
| Guys,I have a select statement. I just need to add default 1 as qty from my select statement. I dont know how to do this.Like..Select esn, date, 1 as Qty from TABLE1Thank you in Advance. |
|
|
Villanuev
Constraint Violating Yak Guru
478 Posts |
Posted - 2011-09-12 : 22:43:57
|
| I tried this one. so far i think this is good enough.Case when Substring(vp.ItemNumber,1,2) ='P3' Then '1' Else ' ' End As Quantity |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-09-12 : 23:49:14
|
please post some sample data and expected result KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-13 : 00:40:51
|
| why you're returning it as varchar? its numeric data so you can return it as int itself?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Villanuev
Constraint Violating Yak Guru
478 Posts |
Posted - 2011-09-13 : 01:02:46
|
| Ah okay. Thank you for clarification. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-13 : 01:20:32
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|