Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does COUNT(*) via SPT yield a character field?
Message
 
 
To
05/11/2010 01:02:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01488353
Message ID:
01488369
Views:
57
>Hi Experts,
>
>Why does the SQL Statement below yield a Character field for TOTALQTY?
>
>
>SELECT A.DATE, F.DESCRIPTOR AS CUSTNAME, E.DESCRIPTOR AS PRODNAME, D.DATE AS PICKUPDATE,
>       COUNT(*) AS TOTALQTY
> FROM XOUT_HO A, XOUT_HODTL B, PARCEL C, JOBORDER D, PRODUCT E, CUSTOMER F
> WHERE A.ID=B.XOUT_HOID AND B.PARCELID=C.ID AND C.JOBORDERID=D.ID AND D.PRODUCTID=E.ID AND
>       D.CUSTOMERID=F.ID AND A.DATE BETWEEN "2010-01-01" AND "2010-10-15" AND YEAR( A.POSTDATE ) > 0
> GROUP BY 1,2,3,4
>
>
>Thanks in advance
>Dennis

Are you using SQL Server? Is so, the dates are in the wrong format and also this condition YEAR(PostDate) > 0 is strange. What is the reason for this?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform