robin thomas
10-19-2006, 08:12 AM
I tried to write a query in visdata. but its not working. Please tell me what i should do.
select * from customer (select lcfloyaltyid as [loyaltyid],lcfdateofbirth as [lcfdob],lcfanniversary as [anniversary],lcfspousedob as [spousedob], 0 as 'lccdateofbirth' from loyaltycardfamilyinfo where lcfdateofbirth<datevalue('01/01/1910') and lcfdateofbirth<>datevalue('12:00:00 AM') union all select lcfloyaltyid as [loyaltyid],lcfdateofbirth as [lcfdob],lcfanniversary as [anniversary],lcfspousedob[spouse],lccdateofbirth from loyaltycardchildinfo lcc left join loyaltycardfamilyinfo lcf on lcc.lccfid=lcf.lcfid where lccdateofbirth<datevalue('01/01/1910') and lccdateofbirth<>datevalue('12:00:00 AM')) where c.cloyaltyid=lcf.lcfloyaltyid
select * from customer (select lcfloyaltyid as [loyaltyid],lcfdateofbirth as [lcfdob],lcfanniversary as [anniversary],lcfspousedob as [spousedob], 0 as 'lccdateofbirth' from loyaltycardfamilyinfo where lcfdateofbirth<datevalue('01/01/1910') and lcfdateofbirth<>datevalue('12:00:00 AM') union all select lcfloyaltyid as [loyaltyid],lcfdateofbirth as [lcfdob],lcfanniversary as [anniversary],lcfspousedob[spouse],lccdateofbirth from loyaltycardchildinfo lcc left join loyaltycardfamilyinfo lcf on lcc.lccfid=lcf.lcfid where lccdateofbirth<datevalue('01/01/1910') and lccdateofbirth<>datevalue('12:00:00 AM')) where c.cloyaltyid=lcf.lcfloyaltyid