Board index » delphi » !!!!SQL QUERY STATEMENTS!!!!

!!!!SQL QUERY STATEMENTS!!!!

Could anyone please tell me what SQL statement I would use for a query
when I want to search for all records in two feilds in a database: Rem 1
and Rem 2 these two feilds contain months of the year, so in an edit box
the user needs to type in the month there searching for at run-time.  I
havent got a batch thingy so I cannot have multiple SQL statments. I am
a fairly new user so please may you explain step by step in your reply
and please may you reply by mailing me at   g.whitc...@{*word*269}.net
P.S. could you explain what I have to do with the Parameters thing.
Thankyou.

 

Re:!!!!SQL QUERY STATEMENTS!!!!


Quote
Gareth Whitcomb wrote:

> Could anyone please tell me what SQL statement I would use for a query
> when I want to search for all records in two feilds in a database: Rem 1
> and Rem 2 these two feilds contain months of the year, so in an edit box
> the user needs to type in the month there searching for at run-time.  I
> havent got a batch thingy so I cannot have multiple SQL statments. I am
> a fairly new user so please may you explain step by step in your reply
> and please may you reply by mailing me at   g.whitc...@{*word*269}.net
> P.S. could you explain what I have to do with the Parameters thing.
> Thankyou.

SQL: Use the statement
" SELECT * FROM your_database WHERE Rem1=:param1 AND Rem2=:param2 "

and feed your Query like

MyQuery.Close;  {if not closed}
MyQuery.ParamByName('param1').AsString:="hallo";
MyQuery.Open;

For further information, read the manuals or better: buy an SQL-book !

Other Threads