List:General Discussion« Previous MessageNext Message »
From:Brian Dunning Date:January 6 2006 3:44am
Subject:Re: Getting # of days until expiration
View as plain text  
Thanks Peter, that appears to be exactly what I'm looking for, but it  
still gives an error and I've been through it with a fine-toothed  
comb, tried different versions, parens, etc. Here is the exact SQL  
statement I'm using, with your suggestion:

select
	accounts.username,
	meets.id as meet_id,
	DATEDIFF( DATE_ADD( meets.creation, INTERVAL 30 DAY), NOW() ) as  
expire_days
from
	meets
left join
	accounts on meets.id=accounts.id
....blah blah blah lots more stuff.

And here is the exact error I get:

You have an error in your SQL syntax. Check the manual that  
corresponds to your MySQL server version for the right syntax to use  
near '( DATE_ADD( meets.creation, INTERVAL 30 DAY), NOW() ) as expire

Can anyone see the problem? I sure can't.

Thread
Getting # of days until expirationBrian Dunning6 Jan
  • Re: Getting # of days until expirationScott Haneda6 Jan
  • Re: Getting # of days until expirationPeter Brawley6 Jan
    • Re: Getting # of days until expirationBrian Dunning6 Jan
      • Re: Getting # of days until expirationMichael Stassen6 Jan
        • Re: Getting # of days until expirationBrian Dunning7 Jan
          • Re: Getting # of days until expirationJake Peavy8 Jan