What happens if you don't use [year] in DatePart but [yyyy] instead, or [mm] instead of [month]
(w/o square brackets)
>Sergey,
>
>I've downloaded both the eView and also ViewEdit programs. I'll check them out but I really like the graphical drag & drop features of the VFP View Designer. I know that it has it limitations but the latest version in VFP9 is much better than the previous versions so I rarely run into things it can't do for me. Then again, my views aren't that difficult.
>
>FYI ... I finally figured out something that would work with the ODBC/MS SQL 6.5 syntax and the View Designer that would save and reload without complaints. The code looked like this.
>
>
>SELECT Pickdetail.Sku, SUM(Pickdetail.ShippedQty) AS total_qty;
> FROM ;
> dbo.PICKDETAIL Orderdetail;
> WHERE substring(convert(char(12),Pickdetail.editdate,3),4,2) = ( '12' );
> AND substring(convert(char(12),Pickdetail.editdate,3),7,2) = ( '06'
>
>
>Thanks again,
>Robert Wright
>
>
>VFP View Designer is very limited and can properly work with basic views only. You can use third party tools, like eView File #
9474 or
http://www.whitelightcomputing.com/prodvieweditorfree.htm>
>>I've been working with DATEADD & DATEPART but I'm still having problems. My skills in writing SQL is limited, therefore, I use the Query Designer almost exclusively. Using the Query Designer, I've created a view that generates the following SQL:
>>
>>
>
>>SELECT Pickdetail.Sku, Sku.DESCR, Pickdetail.Qty, Pickdetail.EditDate;
>> FROM ;
>> dbo.PICKDETAIL Pickdetail ;
>> INNER JOIN dbo.SKU Sku ;
>> ON Pickdetail.Sku = Sku.Sku ;
>> WHERE DATEPART(year, Pickdetail.EditDate) = 2006
>
>>
>>This code runs fine yielding the expected results while in the design mode but after I save it and try reopen it, I get the following error:
>>
>>"SQL: Column 'YEAR' is not found."
>>
>>Any idea, what's wrong.
>--sb--
>
>MVP VFP
>
>
>"The only reason some people get lost in thought is because it's unfamiliar territory." -- Paul Fix
>
>There are 10 types of people: Those who can read binary, and those who can't.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.