🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
5 messages
5 total messages Started by pepito perez Mon, 15 Nov 1999 00:00
Query with Hour
#1406
Author: pepito perez
Date: Mon, 15 Nov 1999 00:00
13 lines
946 bytes
I have an application in C++Builder 4.0 which works with an Access Database.
One of the database's table have a date/time field, exactly a short time
(17:35) field.

I try to launch a query like" select count(*) from Users where time >
#17:35#". This sentence works well in Access directly but with a TQuery
object it doesn�t work (Syntaxis Error).

I don`t know how to write the hour's format.

Anybody may help me ?

Thank You in advanced.
Re: Query with Hour
#1409
Author: CyberNIK
Date: Mon, 15 Nov 1999 00:00
11 lines
1385 bytes
pepito perez wrote in message <80on09$pom12@forums.borland.com>...
>I have an application in C++Builder 4.0 which works with an Access Database.
>One of the database's table have a date/time field, exactly a short time
>(17:35) field.
>
>I try to launch a query like" select count(*) from Users where time >
>#17:35#". This sentence works well in Access directly but with a TQuery
>object it doesn╢t work (Syntaxis Error).
>


May be you should use

select count(*) from Users where time > "17:35"

It works fine with date fields with values like "02.03.99"

CyberNIK
Re: Query with Hour
#1413
Author: pepito perez
Date: Tue, 16 Nov 1999 00:00
34 lines
1502 bytes
Thank you, but i've tried and it doesn?t work (The same syntax error).

But I have found the solution:
"select count(*) from Users where (format(time,'hh:nn') >=
format('12:10','hh:nn')) "


Thank you, anyway.



CyberNIK <ncs@intsar.com> wrote in message
news:80pq3l$6em10@forums.borland.com...
>
> pepito perez wrote in message <80on09$pom12@forums.borland.com>...
> >I have an application in C++Builder 4.0 which works with an Access
Database.
> >One of the database's table have a date/time field, exactly a short time
> >(17:35) field.
> >
> >I try to launch a query like" select count(*) from Users where time >
> >#17:35#". This sentence works well in Access directly but with a TQuery
> >object it doesn�t work (Syntaxis Error).
> >
>
>
> May be you should use
>
> select count(*) from Users where time > "17:35"
>
> It works fine with date fields with values like "02.03.99"
>
> CyberNIK
>
Re: Query with Hour
#1414
Author: Kim Hellan
Date: Tue, 16 Nov 1999 00:00
26 lines
1208 bytes
You should do:

"Select count(*) from Users where time >#17::35#" (double colons)

Otherwise the BDE mistakes the single colon as the start of a parameter.

Kim Hellan


pepito perez wrote in message <80on09$pom12@forums.borland.com>...
>I have an application in C++Builder 4.0 which works with an Access
Database.
>One of the database's table have a date/time field, exactly a short time
>(17:35) field.
>
>I try to launch a query like" select count(*) from Users where time >
>#17:35#". This sentence works well in Access directly but with a TQuery
>object it doesn�t work (Syntaxis Error).
>
>I don`t know how to write the hour's format.
>
>Anybody may help me ?
>
>Thank You in advanced.
>
>
Re: Query with Hour
#1347
Author: pepito perez
Date: Tue, 23 Nov 1999 00:00
45 lines
1495 bytes
Thank You very much

It works fine.












Kim Hellan <khe@NOSPAMkmd.dk> wrote in message
news:80rmmr$m3h6@forums.borland.com...
> You should do:
>
> "Select count(*) from Users where time >#17::35#" (double colons)
>
> Otherwise the BDE mistakes the single colon as the start of a parameter.
>
> Kim Hellan
>
>
> pepito perez wrote in message <80on09$pom12@forums.borland.com>...
> >I have an application in C++Builder 4.0 which works with an Access
> Database.
> >One of the database's table have a date/time field, exactly a short time
> >(17:35) field.
> >
> >I try to launch a query like" select count(*) from Users where time >
> >#17:35#". This sentence works well in Access directly but with a TQuery
> >object it doesn�t work (Syntaxis Error).
> >
> >I don`t know how to write the hour's format.
> >
> >Anybody may help me ?
> >
> >Thank You in advanced.
> >
> >
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads