Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executereader has no records
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01501091
Message ID:
01516371
Vues:
33
Hi Naomi

My select command is:
SELECT SUM(CALLCOUNT) AS CALLS FROM BI.dbo.BI01 WHERE .....

This is the problem. Sometimes One record will be returned (with Null ?) and other times it will be numeric (The actual Sum)
How do I say:
if (Calls = Null)
{ MyCount = 0 ;}
Else
{ MyCount = Calls ;}

Tia Gerard



>What is your select statement? If your select has SUM in it and there are no records satisfying the condition, it will result in one record with NULL in the SUM field.
>
>>Hi Naomi.
>>
>>Just comong back to this now.
>>Still dont know how to get the count in Sql and test it.
>>x=Convert.ToInt32(Convert.ToDouble(rdrCount["CALLS"].ToString().Trim()))
>>
>>If I use the above, and zero records are 'calculated', a single record with a Blank in CALLS field is returned
>>If say 20 records are returned, 20 (an INT) is returned in CALLS
>>
>>Is there a way to test the Type of CALLS in c#
>>
>>----- Pseudo Code ----------
>>
>>If TYpe(Calls) is Blank and Calls = Spaces
>> Then assume no records returned
>>Else
>> x=Convert.ToInt32(Convert.ToDouble(rdrCount["CALLS"].ToString().Trim()))
>>Endif
>>
>>
>>Regards,
>>Gerard
>>
>>
>>
>>
>>>>Ni Naomi.
>>>>I'm running VFP8
>>>>I wonder why this woudl have changed from 8 to 9
>>>>regards,
>>>>Gerard
>>>>
>>>>
>>>It was changed in VFP9 to be more ANSI-SQL standard. It sure caused some maintenance and hard to find bugs, although the behavior is documented and also was discussed here in the forum.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform