Board index » delphi » hard SQL request...help me please...

hard SQL request...help me please...

I do use Interbase:

I have this table:
table booking(
name varchar(20),
start Date,
end Date)

I have some records in this booking's table: there is a TDateTime stored in
start and end fields.

I must find every record between 1/1/2001 and 12/31/2001 and between
10:00:00 and 12:00:00 and that for every monday and sunday.

How can I do that ???

Thanks

Bob

 

Re:hard SQL request...help me please...


Bob,

Are the fields Date fields or Datetime fields.

I would suggest date fields and time fields seperately. Something like this

 table booking(
 name varchar(20),
 start_Date            Date,
 end_Date             Date,
startDateTime       Time,
endDatetime         Time)

Then the query becomes easy.

HTH

Wayne

Quote
Bob Bedford <bedfo...@NOSPAMhotmail.com> wrote in message

news:3b459a5b_1@dnews...
Quote
> I do use Interbase:

> I have this table:
> table booking(
> name varchar(20),
> start Date,
> end Date)

> I have some records in this booking's table: there is a TDateTime stored
in
> start and end fields.

> I must find every record between 1/1/2001 and 12/31/2001 and between
> 10:00:00 and 12:00:00 and that for every monday and sunday.

> How can I do that ???

> Thanks

> Bob

Re:hard SQL request...help me please...


Interbase doesn't have any time type: The time is inside the date field.
May I create it ??? how ???

"Wayne" <wa...@mweb.co.za> a crit dans le message news: 3b45b3ae_1@dnews...

Quote
> Bob,

> Are the fields Date fields or Datetime fields.

> I would suggest date fields and time fields seperately. Something like
this

>  table booking(
>  name varchar(20),
>  start_Date            Date,
>  end_Date             Date,
> startDateTime       Time,
> endDatetime         Time)

> Then the query becomes easy.

> HTH

> Wayne

> Bob Bedford <bedfo...@NOSPAMhotmail.com> wrote in message
> news:3b459a5b_1@dnews...
> > I do use Interbase:

> > I have this table:
> > table booking(
> > name varchar(20),
> > start Date,
> > end Date)

> > I have some records in this booking's table: there is a TDateTime stored
> in
> > start and end fields.

> > I must find every record between 1/1/2001 and 12/31/2001 and between
> > 10:00:00 and 12:00:00 and that for every monday and sunday.

> > How can I do that ???

> > Thanks

> > Bob

Re:hard SQL request...help me please...


Quote
Bob Bedford wrote:

> Interbase doesn't have any time type:

        Not true; IB 6 SQL dialect 3 has a TIME type which is time only.

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:hard SQL request...help me please...


I do use IB5.5 shipped with Delphi 5 Entreprise. So I cannot use this
type...But if there is a way to create it (I thing date are stored at Double
type, and a conversion is done for storing a date and the time)
I don't know how to do that, but I will then store the time as a Double
type, maybe a function will traslate everything in time, or just put a DATE
field with date set to a default date that cannot be used anymore....
Not sure it's the best way to do things...

Thanks anyway for help.

Bob
"Craig Stuntz (TeamB)" <cstuntz@no_spam.vertexsoftware.com> a crit dans le
message news: 3B45B9CB.9BE95271@no_spam.vertexsoftware.com...

Quote

> Bob Bedford wrote:

> > Interbase doesn't have any time type:

> Not true; IB 6 SQL dialect 3 has a TIME type which is time only.

> -Craig

> --
> Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
> Delphi/InterBase weblog:   http://delphi.weblogs.com
> Use Borland servers; posts via others are not seen by TeamB.
> For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:hard SQL request...help me please...


Quote
Bob Bedford wrote:

> I do use IB5.5 shipped with Delphi 5 Entreprise.

        Please do not use IB 5.5 on Windows.  It has serious bugs which can
corrupt your DB.  Get the update to 5.61 from Borland or move to IB 6.

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Re:hard SQL request...help me please...


Quote
"Bob Bedford" <bedfo...@NOSPAMhotmail.com> wrote in message

news:3b45c344$1_1@dnews...

Quote
> I do use IB5.5 shipped with Delphi 5 Entreprise.

Then you'll have to separate the time portion in another date type field.
Also the day of week should be stored in another field (integer).

Other Threads