Hi, I have the following query:select contact1.accountno, contact1.company, contact1.zip, contact1.source,contact1.key2, contact2.urepname, contact2.uregion, contact2.umlastupd, contact2.umstatus, contact2.umallocate, contact2.umaddedby, contact2.umcamp, contact2.umsource, contact2.ummonth, contact2.umgp,month(umlastupd) as 'MonthLastUpd',from CONTACT1INNER JOIN CONTACT2 ON CONTACT1.ACCOUNTNO = CONTACT2.ACCOUNTNOwhere umlastupd is not nullorder by ummonth
Results looks like:B0100124108H%(N0?Mik Example BS10 5PY VALE ACCOUNT 504 NAME *AREA* 15 2011-03-22 00:00:00.000 New NULL MIS NULL Kyocera NULL NULL 3A6022258598)OM>U8Mrs Exxamp;le Ltd. CV21 2UU Dunn & Bradstreet 524 NAME *AREA* 15 2011-07-25 00:00:00.000 NULL JCHAPMA NAME GCL Leads Telemarketing NULL NULL 7
What I also want to do is return from another file (CONTHIST) the DATE of a matching record.So the other file contains the same Account No's as above, in a format like below:AccountNo Ondate Ref
What I want to do is select the ONDATE for a Record in there where the REF = 'MARKETING'. So in theory my first query should produce a field with a DATE in it.