SQLTeam.com | Weblogs | Forums

How to write this query ?need help


#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.


#2
SELECT *
FROM  HHU.dbo.tbl_fr
WHERE batch_no   = @batch_no
AND   bill_month = @bill_month

#3

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.


#4

sqlserver 2005. i m using sqlcmd to access the requied data


#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 ?