Hi there
I would like to know if what im trying is possible
In the software that i do support for we have customer memos. What actual memos that customer has is held on a table called 'Customer memos'
Memos can have various different datatypes Text,Date,Money these are all held on one table called customer memos.
There is also one other type we call a 'due date', which is a group of 3 dates (this is used to see when a customer last renewed the subs and when their due again)
Table 1 'Customer Memos'
Memoid/CustId/TextValue/DateValue/MoneyValue
Table 2 'Customer Dues'
memoid/Custid/lastdue/lastActual/nextdue
For the Client (My Customer) we have set something that allows them to choose what cust memo they want to report on. which would be fine if all the memos are all on one table. I think i need to be able to say
Case Memo Id = "1" then
Join this table
else
Join this table
END
or something like that
This Is what i have already
Declare @MEMO
SET @memo = {{User Picks What Memo they want}}
SELECT c.CustId, c.displayname,
CASE
WHEN @Memo = 22 THEN cd.NextdueDate
WHEN @Memo = 88 THEN cm.DateValue
END
AS Memo
FROM Cust c
INNER JOIN custdues cd ON c.custid = cd.custid AND cd.memoid = 22
INNER JOIN custmemos cm ON c.custid = cm.custid
But no matter that the user pick the code thinks that its looking in both tables for the one field
Can i do this in one report or will i need two
Ian