Auto Update Database Using Date

Results 1 to 2 of 2

Thread: Auto Update Database Using Date

  1. #1
    dclark Guest

    Default Auto Update Database Using Date

    Alright...I&#039m tired of fighting with this. Maybe one of you can help.<BR><BR>I&#039m writing an SQL Update string that will change info in one field only when the posted date (in a separate field) has surpassed 45 days. I can&#039t seem to get the date comparison to work.<BR><BR>I&#039m using Access. My date field (called postdate)is formatted as shortdate. I&#039ve tried using a DATEADD function to hold a date 45 days prior to today and then compare that against the postdate value.<BR><BR>What am I doing wrong...someone please help before I spend 45 days working on this!!! Thanks.

  2. #2
    Jesus Rocha Guest

    Default RE: Auto Update Database Using Date

    Maybe the DATEDIFF function can help you. With the DATEDIFF function you can calculate the number of days between two dates.<BR><BR>DATEDIFF(interval,date1,date2), where interval can be:<BR> y =&#062; day of the year<BR> w =&#062; day of the week<BR> d =&#062; day<BR> m =&#062; month<BR> yyy =&#062; year<BR> h =&#062; hour<BR> ...<BR><BR>para calcular el número de dÃ*as entre dos fechas

Posting Permissions

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