Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query, Needing 2 different values...

Status
Not open for further replies.

danneedham

Programmer
Dec 19, 2007
30
GB
Hi All

The title doesnt really make sense, but hopefully I can expain a bit more...

I am trying to create a query from two tables, admin and financial dates.

TYWeekFrom 0801
TYWeekTo 0802

to query table financial dates

FinancialWeek, DateFrom
eg. 0801 27/01/08
0802

I will be using these two dates to use a between statement in the query too.

Any help greatly appreciated.


Dan
 
Maybe posting your table structures would make your question clearer. And explain what you want as an expected result. eg.
tblAdmin
AdminID
etc.

tblFinancialDate
FDID
etc.
 
After much playing i've found a solution!!

SELECT Sales_Sales.ID, Sales_Sales.StoreID, Sales_Sales.TDate, Sales_Sales.ADate, Sales_Sales.Amount, Sales_Sales.EntryType
FROM Sales_Sales, (Core_Admin INNER JOIN Core_FinancialWeek ON Core_Admin.CUMTYFROM = Core_FinancialWeek.FinancialWK) INNER JOIN Core_FinancialWeek AS Core_FinancialWeek_1 ON Core_Admin.CUMTYTO = Core_FinancialWeek_1.FinancialWK
WHERE (((Sales_Sales.TDate) Between [core_financialweek].[DateFrom] And ([Core_FinancialWeek_1].[DateFrom]+6)));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top