Hello, I want to link a table to 2 other tables in order to change its values.
I wrote:
CurrentDb.Execute "UPDATE Table1
INNER JOIN Table2 ON Table1.column = Table2.Column,
Table3 ON Table1.Column = Table3.Column
SET Column2 = Table2.Column2
WHERE Table3.Column = Table1.Column;"
But is...
Date: [Date1]-Day([Date1])+Day([Date2])
I know this has some problems with it...because it is not running...but can this be possibly done and if yes how?
Thank you!
I used the query builder to create the query, then copy and pasted the whole SQL into VBA.
I need it in VBA because i need a series of actions to be done on the click of a button.
I copy and pasted the whole thing so it shouldnt be wrong...that is why i am so confused now...><
Im trying to make a new table with selected columns and selected records.
A simpler version maybe:
SELECT Table.* INTO Newtable FROM Table GROUP BY Column1 HAVING Column1 = "Criteria"
Im typing out the whole thing because I dont know where in the code it has gone wrong....
I have got problems runnign this SQL it says its got Data type mismatch...
what does it mean and why is this happening??
Thank you!!
Sqlstr = ""
Sqlstr = Sqlstr & "SELECT IL4010DA.Pnumber, IL4010DA.Code, ([ValDate]-Day([ValDate])+Day([Pyd])) AS fdate...
When I run this code it says "Invalid use of Null", but all my vairables have values...i dont understand what it has got to do with Null...=(
If tmpyr = "Y0" Or bus_type = "FB" Then
r = 0
Else
r = Max(0, DLookup(tmpyr, "CSV_" & bus_type, "Age=" &...
CurrentDb.Execute "UPDATE ValuationDate SET Valdate = Forms![MainScreen].[InputDate].Value;"
tmpvaldate = Forms![MainScreen].[InputDate].Value
CurrentDb.Execute "UPDATE ValuationDate SET Valdate = tmpvaldate;"
both of them didnt work...=(
Or even sth like this with two conditions:
If (rst![bsa] = 0) And (Left(Trim(rst![code]), 4) = "JYRP") Then
rst.Edit
rst![Rcode] = "JYRCI" & Right(Trim(rst![code]), 1)
rst.Update
End If
Sorry 1 more question. what if i want to write
If rst![prem] = 103.56 Then
rst.Edit
rst![prem] = 101.52
rst![eprem_o] = 2.04
rst.Update
End If
with two SETs. what is the format required?
Thankyou very much!!
How do i convert this into SQL??
Thanks =)
rst.MoveFirst
Do
rst.Edit
rst![ValDate] = Forms![MainScreen].[InputDate].Value
rst.Update
rst.MoveNext
Loop Until rst.EOF
rst.Close