I'm not certain whether this can even be done with SQL.  What I would do is use 
ColdFusion for the calculations and based upon your logic below, either display or not 
display the records.

---mark

--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Efax.com Fax: (801) 730-7289
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net 
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------


> -----Original Message-----
> From: Owens, Howard [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 19, 2000 4:01 PM
> To: CF-Talk
> Subject: (SQL) Date column x year column
> 
> 
> 
> 
> 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

Reply via email to