Skip to main content
Participant
April 7, 2008
Question

Date help!

  • April 7, 2008
  • 1 reply
  • 228 views
Hi there,

I am trying to build a week view calendar, to view appointments. I am displaying a 7 column table for the days of the week (Sunday to Saturday across the top), but I also wish to add the date. I can get as far as the putting a date next to today's date but having trouble putting a date next to previous and subsequent days.

This is what I have at the moment (Please see code). As you can see, I have just set an empty string for dates other than today, because I can't get the logic quite right.

If anybody can give me any tips, it would be greatly appreciated.

Cheers.


    This topic has been closed for replies.

    1 reply

    Inspiring
    April 7, 2008
    It's probably easier to find your Sunday first and then add 7 days.

    StartDate = Now();
    while (dayofweek(StartDate) gt 1)
    StartDate = dateadd("d", -1, StartDate);

    Now you can loop from 1 to 7 to display whatever you want.