Peter Thompson
Active Member
- Joined
- Dec 15, 2008
- Messages
- 262
Hello,
I am having issues getting a join to work. The issues I am having appears to be due to the transaction date.
There are two tables the data table (Oracle_Transaction_Data) has a standard date time format with both the data and the time showing, while the Date table has just the Date. In order to get the tables to join I have used int on the date time field in the subquery, which should then enable it to be joined to the date table, however, I get the message "The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data."
Does anyone have any ideas.
Thanks,
Peter
I am having issues getting a join to work. The issues I am having appears to be due to the transaction date.
There are two tables the data table (Oracle_Transaction_Data) has a standard date time format with both the data and the time showing, while the Date table has just the Date. In order to get the tables to join I have used int on the date time field in the subquery, which should then enable it to be joined to the date table, however, I get the message "The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data."
Code:
SELECT C.Store_Name,
b.Transaction_Date,
sum(B.Net_Sales) AS Net_Sales,
Sum(B.Quantity) AS Quantity,
Count(B.Transaction_Number) AS Transactions,
Sum(B.Net_Sales)/count(B.Transaction_Number) AS ATV,
D.ISO_WEEK_NUMBER
FROM (SELECT a.shop AS Shop, int(A.Date_Time) AS Transaction_Date, a.transaction AS Transaction_Number, sum(A.Net_Value) AS Net_Sales, sum(A.quantity) AS Quantity
FROM Oracle_Transaction_Data AS A
GROUP BY int(A.Date_Time), A.shop, A.transaction) AS B,
Stores AS C,
Date_Table AS D
WHERE B.shop=c.store_number
And B.shop=15
And B.Transaction_date =d.date
GROUP BY c.store_name, b.transaction_date, b.transaction_number, d.ISO_WEEK_NUMBER;
Does anyone have any ideas.
Thanks,
Peter