Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bool in SQL & setup of Update Query

Status
Not open for further replies.

Maladon

Programmer
Oct 5, 2001
25
0
0
US
I am attempting to set up a query in Borland C++ Builder4.0
I have asked this question in that forum but am hoping to increase my chances of a solution.

Here is my question in the short version:
1) How do you get a TQuery to accept type bool and act on it and
2) what is the correct means of setting up an Update Query

Here are the details if you care to see what I've already tried:

I have a functioning DB application where I use TQuery to Sort Ascending or Descending. I can edit and apply an SQL string on the fly to also Filter on any field
value. I can turn either the filter or the sort on or off with no adverse reactions.
Basicly everything works great.

Here's the problem. I want to Filter the table on a boolian field (true/false).
I can't get SQL to recognize Boolian values, I always get a blank filter.
Next, I want to pass 2 params to the Query; :paid, :Closed_Date
Then I want to SET Closed_Date = Date() IF Paid = true.

The UPDATE SQL will not generate any code unless there is a select * Table
in the TQuery SQL. If I add that I get a good SQL statment from UPDATE
but it will not run. ( No params in the TQuery. )
params will not allow adding of params directly, only through the SQL text.
So I add VALUES :paid, :Closed_Date
Now I get either a "syntax error" or, depending on how I play with the query text,I may get "Error creating cursor handle".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top