Article View: borland.public.vdbase.data.sql
Article #96Re: Dates in SQL
From: John Staub
Date: Wed, 13 Jan 1999 00:00
Date: Wed, 13 Jan 1999 00:00
39 lines
2022 bytes
2022 bytes
Steve, Thanks!! I didn't think there was a way, but I am still _very much learning SQL. One of my books mentioned an Add_Months statement, but that bombed. I will probably go the parameter route. John -- Staub & Associates, Inc. (850) 913-8488 http://www.staubassociates.com Buy books, music & video online at http://www.staubassociates.com/bkstore.htm Steve Koterski wrote in message <369d26f8.1459659@forums.inprise.com>... >On Wed, 13 Jan 1999 15:00:56 -0600, "John Staub" ><bmds@send_me_nothing_worldnet.att.net> wrote: > >[...] > >>There is a date field in the table (crtmld is the field) that I would like >>to test. Basically I want to know if (crtmld + 60 < date()) and if so, >>include it. I understand SQL does not support the date() function, but does >>anyone know of an equivalent in SQL? I've tried a variety of approaches to >>no avail. > >No. Local SQL does not include a function (like CURRENT_DATE in SQL-92) >that returns the system date to an SQL statement. You would need to either: > >1. Build the SQL statement dynamically and express the date as a literal. >2. Pass the date to the statement using a parameter. > >////////////////////////////////////////////////////////////////////////// >Steve Koterski "I do most of my writing sitting down. >Technical Publications That's where I shine." >INPRISE Corporation -- Robert Benchley (1889-1945) >http://www.inprise.com/delphi
Technical Details
Message-ID:
<77jesr$sm120@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<77j1h0$sll12@forums.borland.com> <369d26f8.1459659@forums.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,e21b85d41667a82e X-Google-Attributes: gidff5a1,public From: "John Staub" <bmds@worldnet.att.net> Subject: Re: Dates in SQL Date: 1999/01/13 Message-ID: <77jesr$sm120@forums.borland.com> X-Deja-AN: 432349054 References: <77j1h0$sll12@forums.borland.com> <369d26f8.1459659@forums.inprise.com> X-MIMEOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.vdbase.data.sql