|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Upsizing problems
Sorry if this is a dumb question but I'm new to SQL and am tearing my hair out.
I have upsized an Access DB I have imported a load of queries but they don't work. In Access they are cross tab queries, I assume that I need to change the query in some way the current code that works in Access is: TRANSFORM Count(Qry_Orders12Months.OrderStatus) AS CountOfOrderStatus SELECT Customers.CustomerID FROM Customers INNER JOIN (Orders INNER JOIN Qry_Orders12Months ON Orders.OrderID = Qry_Orders12Months.OrderID) ON Customers.CustomerID = Orders.CustomerID GROUP BY Customers.CustomerID PIVOT Qry_Orders12Months.OrderStatus In ("Current","Dormant"); I also have a problem with another query that uses the If Function as well the current code is: SELECT Orders.OrderID, Orders.OrderDate, Date() AS StartDate, DateSerial(Year([StartDate]),Month([StartDate])-12,Day([StartDate])) AS 12Months, IIf([OrderDate]>=[12Months],"Current","Dormant") AS OrderStatus FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID; Thanks in advance for any help anyone can give me |
|
#2
|
|||
|
|||
|
Your queries use functions that are not in SQL Server
http://msdn.microsoft.com/library/en-us/tsqlref/ts_tsqlcon_6lyk.asp
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Upsizing problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|