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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sql query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-18 : 09:05:57
rahul writes "sir,
i am facing one big problem hope u wil help it.

in my sql table fields are like this
cust_id char(8)
entrydate datetime
entrytime datetime

now i want to retrive like one cust_id (say ABB456) and all the date where he has entered.like this for all cust_id.
mean how many time during the month customer has entered
and reports should be for all customers.

will you tell me how to perform the query so that i will get the desired result.
i want this results in an asp page.if you are kind enough to tell me how to place query result in asp page

note: cust_id is repetitive where as entrydate is unique for every customer"

nr
SQLTeam MVY

12543 Posts

Posted - 2001-12-18 : 09:59:14
to get everything for this month

where datepart(mm,getdate()) = datepart(mm,entrydate)
and datepart(yy,getdate()) = datepart(yy,entrydate)

I suspect you can do the customer ID bit
Then either select count(*) for the number of entries or select * for the actual entries.


==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -