SQL open Query error when no data available
Posted on 2003-11-27
I have database that content prices during a year. Im using SQL to find the max and min value in a defined range of date from my database.
my problem is :
for example the file for year 2003 is not completed yet (only until november). When I run the program to find the max and min value for December, the program will be error when the SQL is opened because the prices data is empty.
How to indicate that the SQL doesn't find the value for tha max and min value before I openned the SQL, so that the error wont happened ?
I tried to used : if Query1.IsEmpty = true then ShowMessage(bla bla ..);
but it doesn't work. The program will also show me the message if I choose another date range... even if the data is available (for example : if I choose March, it will show me the message also)
ps: I dont want to put zero as my defalut value in my database, because later the result for my min. value is always zero where else the price never goes to zero
ok that's all I want to ask... thank youuu ^^