Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Posts
    89

    Unanswered: Edit a query (add date) when data is collected.

    Hi
    I have a question and hope someone can help me.

    I have a query that sort data from a table and this data is used in a report.
    Bud when this happens i want a the current date to be added in these records.

    What I want to achieve is when the report is sent i want these records to be noted as sent and the date when it has been sent.

    Hope someone can tell me how I can get this done...

    thx

  2. #2
    Join Date
    Dec 2012
    Location
    Logan, Utah
    Posts
    163
    I am not really clear on what you are looking for.

    Do you want to add today's date in the query or are you looking to update a table with today's date for those rows that were in the query?

    1. Select columnNames, Date()
    From someTable
    Where some condition exists

    2. Update someTable SET
    ColumnDate = Date()
    where some condition exists


    Some DLL and Insert statements would go a long way in making the reply more meaningful.

  3. #3
    Join Date
    May 2012
    Posts
    89
    Hi LinksUp.

    I am indeed looking to update a table with today's date for those rows that were in the query.

    If got nothing special in the query, except (tblOPSLAG.Opgestuurd) Like "")
    And the (tblOPSLAG.Opgestuurd) is where the current date.
    And the query generate record where the (tblOPSLAG.Opgestuurd) is: like ""
    And after the report or form open the (tblOPSLAG.Opgestuurd) must contain the date that the (tblOPSLAG.Opgestuurd) is opened.

    - I want to know when certain records are used in a query (form or report)
    - and these records wont come in the query again.

    SELECT tblOPSLAG.Gemeldt, tblOPSLAG.Gebouw, tblOPSLAG.Verdieping, tblOPSLAG.Soort, tblOPSLAG.LocatieOmschrijving, tblOPSLAG.Opgestuurd
    FROM tblOPSLAG
    WHERE (((tblOPSLAG.Opgestuurd) Like "")) OR (((tblOPSLAG.Opgestuurd) Not Like "*"))
    ORDER BY tblOPSLAG.Gemeldt, tblOPSLAG.Gebouw, tblOPSLAG.Verdieping, tblOPSLAG.Soort;

  4. #4
    Join Date
    Dec 2012
    Location
    Logan, Utah
    Posts
    163
    Code:
    SELECT tblopslag.gemeldt
         , tblopslag.gebouw
         , tblopslag.verdieping
         , tblopslag.soort
         , tblopslag.locatieomschrijving
         , tblopslag.opgestuurd
      FROM tblopslag
     WHERE (tblopslag.opgestuurd) LIKE "" )
        OR (tblopslag.opgestuurd) NOT LIKE "*" )
     ORDER BY tblopslag.gemeldt
            , tblopslag.gebouw
            , tblopslag.verdieping
            , tblopslag.soort
    I still don't understand everything you said, but if all you are trying to do is update your table for those rows returned by the query above, then turn the select statement into an update statement.

    Code:
    UPDATE tblopslag 
         SET tblopslag.opgestuurd = Date()
     WHERE (tblopslag.opgestuurd  LIKE "")
       OR (tblopslag.opgestuurd NOT LIKE "*" )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •