I am building a site that uses a redemption card system and thus need to display some redemption data in a chart on an ASPX page. The chart needs the data in the following format.
Status | Count
-------------------------------------------------
NotReemed | 25000
Redeemed | 14000
I am using currently using the following SQL Statement to obtain the data
---
SELECT
NotRedeemed =(SELECT count(*)
FROM tbl_codes INNER JOIN
tbl_batches ON tbl_codes.Batch _ID = tbl_batches.Bat ch_ID
WHERE (tbl_codes.IsUs ed = 0 AND LEFT(tbl_codes. Redeem_Code_Pre fix = 'WHATEVER')
Redeemed =(SELECT count(*)
FROM tbl_fans
WHERE LEFT(Redeem_Cod e_Prefix = 'WHATEVER'
---
Using this obtains the correct data but the data is obviously in the following format:
NotRedeemed | Redeemed
------------------------------------------------
25000 | 14000
If someone could give me an idea of how to get the data in the correct format (as per the first example) it would be much appriciated.
Status | Count
-------------------------------------------------
NotReemed | 25000
Redeemed | 14000
I am using currently using the following SQL Statement to obtain the data
---
SELECT
NotRedeemed =(SELECT count(*)
FROM tbl_codes INNER JOIN
tbl_batches ON tbl_codes.Batch _ID = tbl_batches.Bat ch_ID
WHERE (tbl_codes.IsUs ed = 0 AND LEFT(tbl_codes. Redeem_Code_Pre fix = 'WHATEVER')
Redeemed =(SELECT count(*)
FROM tbl_fans
WHERE LEFT(Redeem_Cod e_Prefix = 'WHATEVER'
---
Using this obtains the correct data but the data is obviously in the following format:
NotRedeemed | Redeemed
------------------------------------------------
25000 | 14000
If someone could give me an idea of how to get the data in the correct format (as per the first example) it would be much appriciated.
Comment