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 |
|
Kavyanjalisfriend
Starting Member
1 Post |
Posted - 2010-10-07 : 06:38:45
|
| Hi Friends,I m trying to work on the query-procedure but finding it difficult to get the output.I m passing parameter through front end want d result through parameter only.Here is my Query-ProcedureDeclare @InvoiceNo varchar(500)SET @InvoiceNo = '10058984,10058986,10058982'Select InvoiceNo ,Invoicedate,PartyName from InvoiceTable Where Convert(Varchar,InvoiceNo )in (@InvoiceNo)Desired Out PutInvoiceNo,Invoicedate ,PartyName 10058984 ,02/02/2010 ,Reliance10058982 ,02/02/2010 ,TCS10058986 ,02/02/2010 ,Opera TownIf do like this (InvoiceNo has Int datatype)Select InvoiceNo ,Invoicedate,PartyName from InvoiceTable Where InvoiceNo in (10058984,10058986,10058982))It gives me the desired out put as shown above but not with the parameter.Please help me to get the solutionThanks in advanceRegards,ChandrakantChandrakant |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-10-07 : 06:45:16
|
| [code]Select InvoiceNo ,Invoicedate,PartyName,@InvoiceNo from InvoiceTableWhere InvoiceNo in (10058984,10058986,10058982)[/code]PBUH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-10-08 : 06:08:59
|
| Select InvoiceNo ,Invoicedate,PartyName from InvoiceTable Where ','+@InvoiceNo+',' like '%,'+Convert(Varchar(15),InvoiceNo)+',%'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|