ary92
September 20, 2015, 3:27pm
1
I have a tabel name tbl_fr
it has several fields
[mr_recno]
,[bill_month]
,[batch_no]
,[mr_sdiv]
,[mr_sub_batch]
,[mr_cons_no]
,[mr_refNo]
i want query that takes Bill_month and Batch_no as input form the user to retrieve
specific month and batch no data.my database name is HHU.
khtan
September 20, 2015, 10:29pm
2
SELECT *
FROM HHU.dbo.tbl_fr
WHERE batch_no = @batch_no
AND bill_month = @bill_month
Kristen
September 21, 2015, 6:39am
3
ary92:
as input form the user
How are you getting the input from the user? What type of application / language / platform?
That won't make any difference to the actual SQL you need, but people here may be able to advise on how you send the query from the application to the SQL Server.
ary92
September 21, 2015, 5:06pm
4
sqlserver 2005. i m using sqlcmd to access the requied data
Kristen
September 21, 2015, 11:11pm
5
OK, but how are you getting the input from the user - i.e. the criteria Parameters for the report such as Bill_month and Batch_no ?