Now I Change it
for 3 update Query's
Without the function
Syntax for a Function called in an Update Query and how to insert the desired task in the function.
In the middle of an Update Query, I want to run a function that should return a value depending on the task. The task performed is the date field of this row.
The Function Name is "BeforeDate"
StringSQL= "Update Table SET Table .Period = " & BeforeDate("Table.[Date]")
If I write the above code to return the desired value, I get the following error message:
"System.InvalidCastException: 'Conversion from string "Table.[Date]" to type 'Date' is not valid.'"
What is the proper syntax to accomplish the above?
Developer technologies Visual Studio Other
-
tovia schlesinger 241 Reputation points
2020-12-31T21:42:09.887+00:00
1 additional answer
Sort by: Most helpful
-
tovia schlesinger 241 Reputation points
2020-12-31T18:55:53.267+00:00 now I changed the Quary Like this
StringSQL = "Update Table SET Table.Period = {BeforeDate(Table.[Date])}"
StringSQL &= " WHERE (((Table.[Date]) < #{BeforeDate(Table.[Date])}#) "I Added { }
And i got a error
System.Data.OleDb.OleDbException: 'Malformed GUID. in query expression '{BeforeDate(Table.[Date])}'.'