Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 4 of 4 total |
extract year and month |
Wed, Nov 5 2008 10:16 AM | Permanent Link |
"Harry de Boer" | LS,
Given the following query SELECT DISTINCT id FROM vh WHERE jaar >= extract(year from current_date) AND maand >= extract(month from current_date) //jaar, maand (integer fields for year and month) {there is no day or date field} 2008 12 2009 01 2009 11 The middle record isn't in the resultset. What's the right query for giving back all the records that equals today or are in the future? Regards, Harry |
Wed, Nov 5 2008 10:38 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Harry
Ahhh one of the perennial favourites. >SELECT DISTINCT id >FROM vh >WHERE jaar >= extract(year from current_date) >AND maand >= extract(month from current_date) > >//jaar, maand (integer fields for year and month) {there is no day or date >field} >2008 12 >2009 01 >2009 11 > >The middle record isn't in the resultset. What's the right query for giving >back all the records that equals today or are in the future? Try something along the lines of SELECT DISTINCT id FROM vh WHERE (jaar * 100) + maand >= (extract(year from current_date) *100 )+extract(month from current_date) Roy Lambert [Team Elevate] |
Wed, Nov 5 2008 11:46 AM | Permanent Link |
"Robert" | "Harry de Boer" <harry@staaf.nl> wrote in message news:8FA27D4C-723B-4A56-80EF-768AE888A938@news.elevatesoft.com... > LS, > > Given the following query > You want (jaar = year and maand >= month) OR (jaar > year) Robert |
Wed, Nov 5 2008 11:52 AM | Permanent Link |
"Harry de Boer" | Thanks for the answers. There are indeed more roads to Rome
"Harry de Boer" <harry@staaf.nl> schreef in bericht news:8FA27D4C-723B-4A56-80EF-768AE888A938@news.elevatesoft.com... > LS, > > Given the following query > > SELECT DISTINCT id > FROM vh > WHERE jaar >= extract(year from current_date) > AND maand >= extract(month from current_date) > > //jaar, maand (integer fields for year and month) {there is no day or date > field} > 2008 12 > 2009 01 > 2009 11 > > The middle record isn't in the resultset. What's the right query for > giving back all the records that equals today or are in the future? > > Regards, Harry > > |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |