C#-sql
I am trying to get a report and I know how to do it but I dont like the way of doing it. I have two tables: Customers(id,name etc..), Transactions (transId,customerId,transTotal, transDate etc..) in mssql
what I need is transaction total per month for each customer.
what I am trying to do is write a sql statement for each month and I have two parameters for sql select. startDate, endDate. It is easy to determine startDate (01/month/year), however i couldnt find an easy way of finding last day of the month. and I dont want to do it manually for each month. I need to loop it and there is also fucking february!!
is there any other way of doing this? need a little help, thx !
Last edited by talikardi; 11-07-2006 at 04:10 PM.
|