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
 Transact-SQL (2000)
 Row count issue

Author  Topic 

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-10-07 : 16:33:52
Hi there,
How can I get the number of row counts from this query

SELECT plan_id,payment_id,date_of_payment,payment_amount
FROM tbl_payment_details
WHERE plan= @plan
AND CONVERT(varchar(8),date_of_payment,1)> CONVERT(varchar
(8),getdate(),1)

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-07 : 16:35:16
SELECT plan_id,payment_id,date_of_payment,payment_amount
FROM tbl_payment_details
WHERE plan= @plan
AND CONVERT(varchar(8),date_of_payment,1)> CONVERT(varchar
(8),getdate(),1)

SELECT @@ROWCOUNT

Or just change it to COUNT(*)

Tara
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-10-07 : 16:39:15
[code]
SELECT COUNT(*) AS RowCount
FROM tbl_payment_details
WHERE plan= @plan
AND CONVERT(varchar(8),date_of_payment,1) > CONVERT(varchar(8),getdate(),1)

[/code]



Brett

8-)
Go to Top of Page
   

- Advertisement -