Hi
How do I find out which entry from T_ACCOUNT_DATA is being referenced by T_ORDER_SCHEDULE?
I've written a confirmation report for our current direct debit subscription series, but the SQL's a little dumb, as I'm capturing the max(act_name) where act_type = 7, but if there is more than 1 row for the act_type then I can't be sure I'm getting the correct one...
:(
Ben
Hi Ben,
I am not sure whether you are talking about invoice billing.
if it is about invoice billing, there is another table need to be considered. it is T_INVOICE_BILL_DETAIL.
I have a stored procedure to pick up expired credit cards.
it needs a parameter which is sheduled direct debit date.
have fun
:-):-):-)
USE
[impresario] GO
GO
/****** Object: StoredProcedure [dbo].[LP_MTC_CREDIT_CARD_CHECK] Script Date: 05/18/2009 14:12:18 ******/
SET
ON
create
[LP_MTC_CREDIT_CARD_CHECK] @duedate
@duedate
datetime as
as
/*
[LP_CREDIT_CARD_CHECK] '2009-04-08'
*/
begin
Set
;
declare
int declare
datetime set
set
1
()))
SELECT
T_ACCOUNT_DATA
T_INVOICE_BILL_DETAIL
due_dt
into
#m1
FROM
JOIN
TR_ACCOUNT_TYPE
T_ORDER_SCHEDULE
order_no
GROUP
HAVING
)
ORDER
id
---need check paid order.
#m2
WHERE
drop
End
Hi Ben
Thanks for the response. After some more digging, it turns out the join I was looking for was in the T_ORDER table all along - T_ORDER.act_id.
Don't I feel silly!