Announcement

Collapse
No announcement yet.

xAP issues

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

  • #31
    OK, I guess I figured out what was wrong in the query. The following one works:

    "DELETE * FROM Temperature WHERE DatePart(""n"",CDate(SampleDate)) <>0 AND DatePart(""n"",CDate(SampleDate)) <>3 AND CDate(SampleDate) < " &DateForSQL(CDate(StartDTime))

    This is, however, not retaining records that fall on 30 minute intervals. There are lot more records.

    Michael, I don't quite understand your code how it works and why it retains only those records that fall on 30 minute intervals.

    Comment


    • #32
      It is converting a date to a text string of minutes and looking for the "3" and "0" in the two character minute string. It seems what you are trying to do is working with dates rater than strings. There are likely more than one way to do it, I was just showing what I did many years ago in the mcsTemperature code. When I develop complex queries I usually do it in Access than then take the SQL part for the code.

      Comment


      • #33
        Michael,

        I was just trying to get my code working by trial and error because I'm not an expert with databases. I know your code is lot more efficient in picking up "0" and "3" in minutes. Now I understand why you had "nn" in your code but I have to look at your code more carefully.

        Comment


        • #34
          Michael,

          I have now managed to adopt your code and I can delete selectively records from my database. Many thanks for your help, it really has been crucial. However, I will be missing your mcsTemp plugin when I start using HS3 on my production system (I know you won't be updating the plugin).

          Best regards,
          Jari

          Comment

          Working...
          X