|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 21, 2013 2:46 AM
Points: 7,
Visits: 35
|
|
Hi,
I have a table with the below column headings.
Business Unit Document ID Document Date Year Period Account Descr Dept Product Project Analysis Code Affiliate Currency Base Amount USD Amount Line Descr Reference Vendor Vendor Name Module Doc Line # AP Distrib Line # Post Status Seq
I need to pull data with the document date, account and dept.
Where the document data would be the previous month, there would be multiple accounts: for eg: [FTS Yearly Query].Account >= 847000 and [FTS Yearly Query].Account <=847900 or [FTS Yearly Query].Account = 821000 and multiple depts as well.
and it do not get the required data.
Could someone please help me.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 1:32 PM
Points: 285,
Visits: 1,197
|
|
renato_mech_334 (2/27/2013) Where the document data would be the previous month, there would be multiple accounts: for eg: [FTS Yearly Query].Account >= 847000 and [FTS Yearly Query].Account <=847900 or [FTS Yearly Query].Account = 821000 and multiple depts as well.
Hi: Your question is a little difficult to understand, unfortunately.
But, here's a quick observation I'll share -- if the example criteria you've listed is taken from the sql code, then your results won't likely be as intended. From your example, I think you might try the following with parentheses:
( [FTS Yearly Query].Account >= 847000 and [FTS Yearly Query].Account <=847900 ) or [FTS Yearly Query].Account = 821000
--pete
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 21, 2013 2:46 AM
Points: 7,
Visits: 35
|
|
Hi Pete,
Thanks for the reply.
I figured it out by using it in this format.
WHERE ([FTS Yearly Query].Dept = "3310" ) and ( ([FTS Yearly Query].Account >= 847000 and [FTS Yearly Query].Account <=847900 or [FTS Yearly Query].Account = 821000) and (Year([FTS Yearly Query].[Document Date])* 12 + DatePart("m", [FTS Yearly Query].[Document Date]) = Year(Date())* 12 + DatePart("m", Date()) - 1)
Regards, Renato
|
|
|
|