Wassup Jose Weblog nonsense at its best!

14Jan/091

Odd Case Statement

It's not the worst code I've ever seen and it certainly gets the job done, but i've never seen a case statement written in this manner before.


Select Case True
  Case CDate(.Fields("Status2_Date")) < CDate(.Fields("Begin_Date"))  And CDate(.Fields("Status1_Date")) > CDate(.Fields("Begin_date"))
    .Fields("Begin_date") = .Fields("Status1_Date")
  Case CDate(.Fields("Status2_Date")) > CDate(.Fields("Begin_Date"))
    'Stuff
End Case
Filed under: Blog Leave a comment
Comments (1) Trackbacks (0)
  1. Where do you find this stuff? I would assign dates to local variables to limit property access. I assume .Fields is the reader field collection? Is there an IsDate check somewhere for null checks?


Leave a comment

(required)

 

No trackbacks yet.