Subject | Re: [ib-support] Advice |
---|---|
Author | Paul Schmidt |
Post date | 2002-02-12T22:43:57Z |
On 12 Feb 2002, at 19:24, Luiz wrote:
date, and this is what I do:
SELECT * FROM BIRTHDAYS BETWEEN 15/02 AND 18/06
This works ONLY if your not storing the year, otherwise create a
second DATE field, it is the same as the existing one, but the year
is always a specific value, say 100 then you can do the above, but
add your specific year value.
Paul
Tricat Technologies
paul@...
www.tricattechnologies.com
> Claudio,I have situations all the time where I need a starting and ending
>
> > ""Luiz"" <cprmlao@...> wrote in message
> > news:017201c1b375$f5dcfa50$010aa8c0@......
> > > I need advice about which the better choice to a column to store
> > birthdays,
> > > so that locating rows to birthdays in a period will be fast.
> >
> > I don't understand well. There's only one option: the true DATE-only
> > type
> in
> > dialect 3. This is internally a signed long integer.
> >
> > Or do you need to sort do a grouping by month, whatever the year is?
> > In
> that
> > case, you could have a trigger that populates a smallint column that
> > keeps separately the month for those purposes even with the date
> > field present. Don't give up that date field, as it's the easier way
> > to calculate date differences and the like.
>
> Let's upon the bitrthsays are(dd/mm):
> 11/03
> 12/03
> 15/04
> 18/06
> ....
date, and this is what I do:
SELECT * FROM BIRTHDAYS BETWEEN 15/02 AND 18/06
This works ONLY if your not storing the year, otherwise create a
second DATE field, it is the same as the existing one, but the year
is always a specific value, say 100 then you can do the above, but
add your specific year value.
Paul
>Paul Schmidt
> If I use a dateonly column and creating a index on this column, it
> will inadequate to use this index to locate persons doing birthdays in
> a period. If I want all person doing birthdays between 11/01 and
> 15/04, what will be the better option to columns saving this values
> and your indexes? A varchar? two smallints, one to month and other to
> day?
>
> Luiz.
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~--> Access Your PC from Anywhere It's Easy. It's
> Fun. - Free Download.
> http://us.click.yahoo.com/V8IZpD/7XkDAA/yigFAA/dpFolB/TM
> ---------------------------------------------------------------------~
> ->
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
Tricat Technologies
paul@...
www.tricattechnologies.com