Sorry, I'll try to better explain myself.
I have a query that totals all the devices in a given field, but, if that
table is empty, CF gives me an error that the variable I set, to see if the
amount on hand is less than what is needed, is undefined, and I wanted to know
if there was a way around that, so it could just read: "DBTABLE is empty, no
records exsist", or something along that line.....
I hope that's clearer, and wouldn't I just make a statement within the CFIF
statement stating that if DBFIELD EQ " " No Records Exsist?
paross1 - 30 Apr 2007 22:14 GMT
You could check the rceordcount variable for your query and if it is <> 0
<cfquery name="your_query" datasource="dsn">
SELECT your_fields
FROM your_table
WHERE whatever
</cfquery>
<cfif your_query.recordcount GT 0>
do whatever you want to do if you have records
<cfelse>
your alternative
</cfif>
Phil
Dan Bracuk - 30 Apr 2007 22:27 GMT
[q][i]Originally posted by: [b][b]noobie2005[/b][/b][/i]
Sorry, I'll try to better explain myself.
I have a query that totals all the devices in a given field, but, if that
table is empty, CF gives me an error that the variable I set, to see if the
amount on hand is less than what is needed, is undefined, and I wanted to know
if there was a way around that, so it could just read: "DBTABLE is empty, no
records exsist", or something along that line.....
I hope that's clearer, and wouldn't I just make a statement within the CFIF
statement stating that if DBFIELD EQ " " No Records Exsist?[/q]
What does "totals all the devices in a given field" mean? What sql are you
running to determine that?