var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: cast as money problem
I am trying to select some dummy currency values in my query which are later populated in code.
so I have for example
SELECT CAST(0.00 as MONEY) AS SPEND1
However I get a 'syntax error (missing Operator) in query.
Am i using the cast expression correctly?
yes you are
but in the wrong database
CAST is SQL Server
ahhh, bugger. how can i do it in access then?
sorry, i can't help you, i don't know what it means to "select some dummy currency values in my query which are later populated in code"
i am running a query in vba using ado recordsets. I want to show some accounts and some spend by month, and then export the recordset to excel. The spends are calculated in code. and then I use
rs.fields("Spend1").value = currSpend.
So all i want is a field in my recordset of the correct datatype that I can then populate.
if in the SQL i do "SELECT ACC, 0 as Spend1, 0 as Spend2 etc etc" it makes the data type an integer, so i want to tell it that the zero is a currency.
I cannot calculate the spends in SQL.
thanks guys that helps, but it causes another problem.
If i do
SELECT targetSpend as Spend1, targetSpend as Spend2 etc etc
(where targetSpend is a random currency field)
i can do
rs.fields("Spend1").value = 25.99
however if i do
SELECT CCur(0) as Spend1, CCur(0) as Spend2 etc etc
when i try to change the value in code as above, i get
'Multi step operation generated errors. Check Each status value'
as an error message!
Simply Spend1 is a calculated field in its basic form. you can't edit/change calculated fields.
well thats a bit of a bind! thanks for your help though guys.
You might try to create Spend fields in table and leave them empty or use a unbound text control. Thats all advice I can give.