Web Analytics Made Easy -
StatCounter Need a few pointers in Asp - CodingForum

Announcement

Collapse
No announcement yet.

Need a few pointers in Asp

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need a few pointers in Asp

    I think this is more of a SQL request.

    I would like to be able to delete old files in my database, that are older them 1 Month.

    Can anyone point me in the right direction?
    Kind regards,
    Mike Hughes

  • #2
    Are you storing some date field(s) in the columns of the data you wish to purge? That would be your criteria.

    fv

    Comment


    • #3
      yes,

      i have appoiment dates and times that are stored. This data only needs to be held for 1 month.
      Kind regards,
      Mike Hughes

      Comment


      • #4
        First of all, take a look at what you might potentially want to delete: Something along these lines:

        select column1
        , column2
        from yourtable
        where (MONTH(CURRENT DATE - AppointmentDate) > 1)

        and see if those indeed meet your criteria

        Comment


        • #5
          What datatype are you storing the date fields as... ?

          Can you provide that along with some sample content?
          Former ASP Forum Moderator - I'm back!

          If you can teach yourself how to learn, you can learn anything. ;)

          Comment

          Working...
          X