quote
Query40.Close;
Query40.SQL.Clear;
Query40.SQL.Add('select SUM(Rm)');
Query40.SQL.Add('from ven.DB');
Query40.SQL.Add('Where Fchv >=:Date1');
Query40.SQL.Add('AND Fchv <=:Date2');
Query40.ParamByName('Date1').AsDate :=DateTimePicker5.Date;
Query40.ParamByName('Date2').AsDate :=DateTimePicker6.Date;
Query40.SQL.Add('AND Sc = ''' + edit25.text +'''' );
Query40.Open;
qrmdform8.QuickRep1.Preview;
end quote
1 I don't know why people build queries on the run!
2 Use Fchv between ?Date1 and ?Date2
3 Don't ever assign values until query is built and active
4 If you are having problems do
try
Transaction.active := true
Query.Execute
I transaction.InTransaction then Transaction.Commit;
except
on E: Exception do begin
ShowMessage(Query.Sql.Text)
end;
end;
5 I use firebird and fb components so syntax prob different
6 Sql and Paradox have an avoidance relationship
7 Paradox is no longer supported - move away from it
8 Use QuotedStr instead of '''
9 What is in Sc?
Mick
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/