Recent content by kwokv616

  1. K

    Question about JOIN!

    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...
  2. K

    Is the DAY() function possible??

    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!
  3. K

    Data Type Mismatch???

    But I dont know how to make the output into a new table. using SQL its INTO TableName Can i do the same when running a saved query? thanks =)
  4. K

    Data Type Mismatch???

    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...><
  5. K

    Data Type Mismatch???

    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....
  6. K

    What is invalid use of Null??

    Thank you very much I'll give it a value of Zero for Nulls!
  7. K

    Data Type Mismatch???

    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...
  8. K

    What is invalid use of Null??

    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=" &...
  9. K

    How can i UPDATE a column with a value input in tht FORM?

    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...=(
  10. K

    Problem with UPDATE function

    Sorry forgot to rename... Pol is another table. It should be sth like this: MySQL = "UPDATE Table1 SET Column1 = Table2.Column1;" DoCmd.RunSQL MySQL
  11. K

    Problem with UPDATE function

    Is this not possible? MySQL = "UPDATE Table1 SET Column1 = Pol.Column1;" DoCmd.RunSQL MySQL If not, how can I do it? Thank you!!
  12. K

    Convert to SQL

    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
  13. K

    Convert to SQL

    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!!
  14. K

    Convert to SQL

    I tried Currentdb.Execute "UPDATE Rid SET Rcode = [Pol].[Rcode] WHERE [Pol].[Pnumber]=[Rid].[Pnumber];" but doesnt work....:(
  15. K

    Convert to SQL

    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
Back
Top Bottom