Source language: Translate to:

Sql Query

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Sql Query

Postby bypass666 » Mon Jun 19, 2017 12:34 am

Hi all

does anyone know a way to successfully run this syntax in DBPro?

SELECT * FROM Workorders
WHERE (DateReceived BETWEEN #[DateQuery1]# AND #[DateQuery2]#)
AND (ModelNumber LIKE [TextEntry42]);

I've tried multiple ways however it just doesn't seem to like it. It seems to be when i enter the second AND.

Many thanks
bypass666
 
Posts: 8
Joined: Mon Jun 16, 2014 9:05 am

Re: Sql Query

Postby dpayer » Mon Jun 19, 2017 7:13 am

If your date is stored in MySQL format (YYYY-MM-DD) you should be able to query with something like:

SELECT * FROM Workorders
WHERE ((DateReceived > #[DateQuery1]#) AND (DateReceived < #[DateQuery2]#))
AND (ModelNumber LIKE [TextEntry42]);
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Sql Query

Postby virger » Mon Jun 19, 2017 7:54 am

Usando DateRec.. con formato dd/mm/yyyy, funciona para mi.
Ussing DateRec.. with format dd/mm/yyyy, works for me.
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 509
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Sql Query

Postby virger » Mon Jun 19, 2017 8:10 am

Disculpe/Sorry
Esto es lo correcto/This is the correct

Usando DateRec.. con formato yyyy/mm/dd, funciona para mi.
Ussing DateRec.. with format yyyy/mm/dd, works for me.
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 509
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Sql Query

Postby bypass666 » Mon Jun 19, 2017 9:03 am

Thanks for the answers guys although i did manage to solve the issue earlier today. The format was MS Access Date.

Inside the DbpExecSQL dialog window:

SELECT * FROM WorkOrders WHERE
DateReceived BETWEEN #[DateQuery1]# AND #[DateQuery2]#
AND ModelNumber LIKE "[TextEntry42]"

This works just fine, thanks again for the info.
bypass666
 
Posts: 8
Joined: Mon Jun 16, 2014 9:05 am


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest

cron