I will try to explain why I ask this by giving an example first:
Suppose we have a sales order database, and there we have the table "Orders". In the table we have columns like "OrderNumber", "Orderdate" and "Shipdate".
OK?
Now we want to know how many days it is between order date and ship date for each order.
According to SQL Standard, as far as I have learnt it, the following SQL Query is then supposed to work:
Code:
SELECT OrderNumber, OrderDate, ShipDate,
CAST (ShipDate - OrderDate AS INTEGER)
AS DaysElapsed
FROM Orders;
But it does not. Instead I got an error message:
"Syntax error (operator missing)..."
After one hours work I did find out this: if I just remove a few things in the second line, and only keep this it works fine:
Code:
ShipDate - OrderDate
So this seems to be the way in Access:
Code:
SELECT OrderNumber, OrderDate, ShipDate,
ShipDate - OrderDate
AS DaysElapsed
FROM Orders;
Now, is there any documentation anywhere that explains how Access works with automatic CAST-conversions?
Including, syntax, what Access does and does not regarding CAST/conversions when you write SQL queries?
Does anyone know?
(When I search for "CAST" or "Conversion" in the internal help system I do not get anything useful.)