I hope somebody can help me out with something that is looking like it's a
SQL problem more advanced than I can handle.
I have two table -- Primary and DuesAdmin. I need to select data from each
table. The WHERE clause needs to be based on the combination of two columns
compared to today's date.
The first clauses would look something like this:
SELECT Primary.FirstName
Primary.LastName
Primary.Email
DuesAdmin.DateofPayment
DuesAdmin.YearsPaid
FROM Primary, DuesAdmin
OK.
Now it gets tricky.
I need to mulitiply DateofPayment by YearsPaid. If that creates a date that
is something short of day, I want to select that row.
To put it another way, I've got people who paid 18 months ago and paid for
one year of membership. I want to find those expired accounts. I've also
got people who paid 3 years ago and paid for 3 years (or 2 years, etc.).
Apparently, I can't multiple the columns and then do a compare (less than)
with today's date.
OK, SQL guru's, how would you do this?
H.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists