Recent content by zhuanyi

  1. Z

    Add new fields in an update query

    thanks for the quick reply. the reason is some of the results are calculated based on the selection results in the previous query. say for example, in the previous query, I selected the age of people, and now I want to categorize them so that if age >60 => senior, age < 20 => children, and...
  2. Z

    Add new fields in an update query

    Hi, i am just wondering is there any chance I could add in new fields (columns) in an update query? Thanks!
  3. Z

    Add in computed numbers to the table

    Hello all, I know this is probably a very easy question, but somehow I am just confused... I have a table, say for example, srcTab that has a couple of columns (say "age", "sex", ...) that I need to select into a new table that I would like to make (call it tarTable) and on top of that, I have a...
  4. Z

    What is the SQL expression for the following?

    By the way, I would like the ending results to be in years please. Thanks!
  5. Z

    What is the SQL expression for the following?

    Hi, What if I need the SQL expression for the following: 31-Dec-2007 - DateofBirth + DateofHire? I tried to use Datediff and dateAdd and it does not seem to allow me to incorporate more than 2 dates. Thanks!
  6. Z

    Multiple joins

    Thanks for the reply. AppendAllFields is a table. The screenshot of the error I have got is attached here. And the full code is here: INSERT INTO [AppendAllFields]SELECT [TreatyList].[Treaty] AS [Treaty],[MLAC 42 Treaty Xref ER].[tai treaty] AS [TreatyType],[txn 01/04].[Policy_Number],[txn...
  7. Z

    Multiple joins

    anyone could help me? please. Thanks!
  8. Z

    Multiple joins

    Hello, I have the following code for a multiple join: INSERT INTO [AppendAllFields]SELECT [TreatyList].[Treaty] AS [Treaty],[MLAC 42 Treaty Xref ER].[tai treaty] AS [TreatyType],[txn 01/04].[Policy_Number] (and more other fields from [txn 01/04] table) FROM [txn 01/04] INNER JOIN [MLAC 42...
  9. Z

    What is wrong with this query

    Never mind, the problem was that my Access database was over the 2GB limit, not because of the query itself. Thanks!
  10. Z

    What is wrong with this query

    Hello, I have a Query that I wrote as follows: SELECT [TableA].[FieldA], [TableA].[FieldB], TableB.FieldC FROM [TableA],TableB RIGHT JOIN [TableA] ON [TableA].[FieldB] = TableB.[FieldD] GROUP BY [TableA].[FieldA], [TableA].[FieldB], TableB.FieldC; What happened was that TableA has Fields A and...
  11. Z

    compare strings in SQL

    oh, i did not Instr will work...thx a lot!
  12. Z

    compare strings in SQL

    Hello, I would like to put a restriction on the SQL statement such that if one particular field contains the character "MO", then we take in the record, else we ignore them. May I know how could this be done in the "WHERE" part of the SQL statement? I do not think SQL would read things like...
  13. Z

    multiple cases

    Hello, Say for example, I would like to run a query that would search through a table with each person's deposit amount, assign band 1 if they have deposit less than 1 million, band 2 if 1-2 million and band 3 if more than 2 million. How can I: 1. Add in the extra column in the table? 2. Assign...
  14. Z

    date error

    never mind, I fixed it, the problem is with the DateValue function, I should have used the DOB directly without the function. Thanks!
  15. Z

    date error

    Hello, I was trying to compare to see whether a date is later than 01/01/1900, and include the date only if it is, I ended up having the following code: ... (([Transactions].BirthDate) Is Not Null) AND (DateValue([Transactions].BirthDate) > #01/01/1900#)) ...; However, I ended up having an...
Back
Top Bottom