Search results

  1. B

    which is the right way ?

    ...and yet, if you save it in Access, it appears as... ONE QUERY. My point, namliam, is that you do not need to create a separate query object in the database; that the whole task can be accomplished in a single SQL statement, which can be saved in a single query instance. You are needlessly...
  2. B

    which is the right way ?

    It CAN be done in Access, but you are correct, the method I used is only good for small-scale tables. For a larger set, it can still be done in Access with a single query, but better done this way: SELECT T1.*, T1.NumField - T2.NumField AS NumDiff FROM MyTable T1 LEFT JOIN ( SELECT...
  3. B

    microsoft access 2003 help needed!!!!

    The following query should work (substitute highlighted text with actual table/field names): SELECT T1.* FROM MyTable T1 WHERE NOT EXISTS ( SELECT T2.* FROM MyTable T2 WHERE T2.[Column X] = T1.[Column X] AND T2.[Column Y] = 0);
  4. B

    which is the right way ?

    This can actually be done with ONE query. Assume a table like the following: MyTable ------- DateField NumField The following query: SELECT T1.*, T1.NumField - (SELECT T2.NumField FROM MyTable T2 WHERE T2.DateField = ( SELECT MAX(T3.DateField) FROM MyTable T3 WHERE...
  5. B

    Excel Automation - Blank worksheet/file

    Set ExcelWbk = appExcel.Workbooks.Add
  6. B

    Testing Value & put Result in Query-URGENT HELP-

    I tested your method, and it achieves exactly the same results as does my method. igourine, do you have some sample data that you can share with us, so that we may test it?
  7. B

    Testing Value & put Result in Query-URGENT HELP-

    Providing that your table structure is something like the following: MyTable ------- DRW N (Drawing Number) DRW Date (Action Date) Action Your SQL should look like the following (substitute highlighted text with actual table/field names): SELECT T1.* FROM MyTable AS T1 WHERE T1.[DRW Date] =...
  8. B

    Access VBA delete entire column or columns and shift lef in Excel

    Then I don't know what else to tell you. Both the Excel-direct method I just gave you, and the DeleteColumn Sub in Access, worked for me. I can only suggest that you double-check your input parameters against the actual names of: * The File * The Sheet * The Range reference for the column deletion
  9. B

    Access VBA delete entire column or columns and shift lef in Excel

    Have you tried executing the column delete statement directly in Excel? Try the following: 1) Open the spreadsheet in Microsoft Excel 2) Select the sheet with the column that you wish to delete (Example: Sheet file1, Column H) 3) Press Alt-F11 to open the Visual Basic window 4) Press Ctrl-G to...
  10. B

    Testing Value & put Result in Query-URGENT HELP-

    Are DRW N and Action the only two fields in your table, or do you also have a date/time field or an Autoidentity field in your table?
  11. B

    Access VBA delete entire column or columns and shift lef in Excel

    Try this somewhat more compact code: Public Sub DeleteColumn( _ ByVal bookname As String, _ ByVal sheetname As String, _ ByVal cellcolumn As String) Const xlShiftToLeft = -4159 Dim oXL As Object Dim oBook As Object Dim oSheet As Object Set oXL =...
  12. B

    Access VBA delete entire column or columns and shift lef in Excel

    In that case: oSheet.Range(cellcolumn).EntireColumn.Delete xlShiftToLeft ...should be the correct code. What error do you get if you use this code?
  13. B

    Access VBA delete entire column or columns and shift lef in Excel

    What are the values that you are passing to the following variables? * bookname * sheetname * cellcolumn
  14. B

    Access VBA delete entire column or columns and shift lef in Excel

    Try: oSheet.Columns(cellcolumn).Delete xlShiftToLeft
  15. B

    Access VBA delete entire column or columns and shift lef in Excel

    Change: oWKSource.Worksheets(strSourceSheet).Range(cellcolumn).EntireColumn.Delete xlShiftToLeft ...to: oWKSource.Worksheets(strSourceSheet).Columns(cellcolumn).Delete xlShiftToLeft
  16. B

    + - a number

    No, T3 is another alias instance of Table1. Within the query, T1 and T3 are alias instances of Table1 and T2 is an alias instance of Table2. I recommend that you spend some time studying table aliases in a query, as well as the use of the EXISTS clause. Expression STAT from the modified...
  17. B

    + - a number

    Revise your query thus: SELECT T2.*, Iif(T3.[First Name] Is Null, 'DOC', 'NAM') AS STAT FROM Table2 AS T2 LEFT JOIN Table1 AS T3 ON T2.[First Name] = T3.[First Name] AND T2.[Last Name] = T3.[Last Name] WHERE EXISTS ( SELECT T1.* FROM Table1 AS T1 WHERE...
  18. B

    + - a number

    For that you would need to create a Form or Report with your query as its recordsource. From there you should be able to apply conditional formatting for the color indicator.
  19. B

    + - a number

    Based on the Table/Field information provided, you could try: SELECT T2.* FROM Table2 AS T2 WHERE EXISTS ( SELECT T1.* FROM Table1 AS T1 WHERE (T1.[First Name] = T2.[First Name] AND T1.[Last Name] = T2.[Last Name]) OR ABS(T1.[Document Number] - T2.[Document...
  20. B

    + - a number

    Your request is rather vague. For instance, you do not state what other fields you are linking/comparing between the two tables besides the number field. Could you provide some sample data/expected output?
Back
Top Bottom