BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MySQL/Delphisyntax - parsing variable to commmandtext

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
p.dr
Guest





PostPosted: Mon Feb 13, 2006 5:03 pm    Post subject: MySQL/Delphisyntax - parsing variable to commmandtext Reply with quote



Hello,

whats wrong with following syntax?

SQLDataset1.CommandText:=('SELECT * FROM history WHERE (date<=dint2 AND
date>=dint1)');

dint1 and dint2 are String variables

something like bellow works fine:
SQLDataset1.CommandText:=('SELECT * FROM history WHERE
(date<="2005-02-01" AND date>="2005-01-01")');

but I need to parse variable to SQL syntax

Thanks, Paul
Back to top
p.dr
Guest





PostPosted: Mon Feb 13, 2006 7:03 pm    Post subject: Re: MySQL/Delphisyntax - parsing variable to commmandtext Reply with quote



Hello folks,

solved myself:

SQLDataset1.CommandText:=('SELECT * FROM history WHERE
(date<='+QuotedStr(dint2)+' AND date>='+QuotedStr(dint1)+')');

See ya

Message by p.dr <p.dr> on: 13.2.2006 8:37:32
Quote:
Hello,

whats wrong with following syntax?

SQLDataset1.CommandText:=('SELECT * FROM history WHERE (date<=dint2 AND
date>=dint1)');

dint1 and dint2 are String variables

something like bellow works fine:
SQLDataset1.CommandText:=('SELECT * FROM history WHERE
(date<="2005-02-01" AND date>="2005-01-01")');

but I need to parse variable to SQL syntax

Thanks, Paul
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.