| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Brian Dunning | Date: | January 6 2006 1:06am |
| Subject: | Getting # of days until expiration | ||
| View as plain text | |||
I have a DATE field that includes a date sometime within the past 30 days. I'm trying to show the number of days until the expiration date, which is 30 days in the future from the date in the field. I've tried a bunch of permutations of something like this: select (30 - SUBDATE(CURDATE() - datefield)) as expiration_days All my permutations give me errors. Can someone set me straight? I'm hoping to get an integer between 1 and 30 (30 day old records are purged separately). Thanks....
| Thread | ||
|---|---|---|
| • Getting # of days until expiration | Brian Dunning | 6 Jan |
| • Re: Getting # of days until expiration | Scott Haneda | 6 Jan |
| • Re: Getting # of days until expiration | Peter Brawley | 6 Jan |
| • Re: Getting # of days until expiration | Brian Dunning | 6 Jan |
| • Re: Getting # of days until expiration | Michael Stassen | 6 Jan |
| • Re: Getting # of days until expiration | Brian Dunning | 7 Jan |
| • Re: Getting # of days until expiration | Jake Peavy | 8 Jan |
