Subject | Re: [IBO] Quick Refresher on bit logical arithmetic |
---|---|
Author | hans@hoogstraat.ca |
Post date | 2002-01-20T21:18:52Z |
select datetime from meetings
where extract(day from datetime) >= 15 // Earliest for 3rd Wed
and extract(day from datetime) <= 21 // Latest for 3rd Wed
and extract(weekday from datetime) = 3 // Must be a Wed
======================================================
lester@... wrote:
where extract(day from datetime) >= 15 // Earliest for 3rd Wed
and extract(day from datetime) <= 21 // Latest for 3rd Wed
and extract(weekday from datetime) = 3 // Must be a Wed
======================================================
lester@... wrote:
>
> I have a table which stores profiles for meetings. They can
> occure weekly, or every third week of the month etc.
> and I have a MEETINGREPEAT integer value that stores bit
> flags for the weeks of the month, and also the day of the
> week. That is all processed nicely onto the user interface,
> with a pop-up to select the week combinations ( and a second
> with 12 month flags as some meetings take a break one or two
> months of the year.
>
> The problem! I now need to select all the records that apply
> to, say, a third wednesday. I think I am right is saying I
> can't do this in SQL, so I need a UDF that will return a 1
> or 0 when the bit flags match the combination I want.
>
> Is that the case, or is there some other way that I am
> missing?
>
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/