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 |
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-01-02 : 01:37:30
|
| hello sirthis is my mssql query--------SELECT LastName+''+ LEFT(FirstName, 3)UserID, LastName as Password from tUseroutput= UserId Pandey JaBut i want output like this=== UserId PandeyJapls help me urgently.gayatri |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-01-02 : 01:39:36
|
| SELECT LastName + LEFT(FirstName, 3)UserID, LastName as Password from tUser |
 |
|
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-01-02 : 01:48:28
|
| siri run your query but again same output.i don't want a space between Pandey Japls help me. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-01-02 : 01:50:15
|
trySELECT rtrim(LastName) + LEFT(FirstName, 3)UserID, LastName as Password from tUser KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-01-02 : 01:54:02
|
| siri run your query but output is same so pls help me.this is mssql query--------SELECT rtrim(LastName) + LEFT(FirstName, 3)UserID, LastName as Password from tUseroutput= UserIdPandey JaBut i want output like this===UserIdPandeyJapls help me urgently.gayatri |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-01-02 : 01:55:59
|
try use ltrim() on the FirstName also KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-01-02 : 02:08:37
|
| thanku very muchits run.thanks again. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-02 : 03:20:05
|
quote: Originally posted by Gayatri D.Patil siri run your query but output is same so pls help me.this is mssql query--------SELECT rtrim(LastName) + LEFT(FirstName, 3)UserID, LastName as Password from tUseroutput= UserIdPandey JaBut i want output like this===UserIdPandeyJapls help me urgently.gayatri
Always use the keyword AS before alias namehttp://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/14/should-alias-names-be-preceded-by-as.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|