Jumat, 05 April 2019

[MS_AccessPros] Date calculations

 

I need help with calculating start and end dates for week, month and year. So far I have the following:


month:
    Me!txtdatefrom = CDate("01/" & Month(Date) & "/" & Year(Date))
    Me!txtDateTo = DateAdd("d", -1, DateAdd("m", 1, Me!txtdatefrom))

I know the txtdatefrom is right. It takes me to January but I need the first date of any month.

weekday

  Me!txtdatefrom = DateAdd("d", (today * -1) + 2, Date)
    Me!txtDateTo = DateAdd("d", 6 - today, Date)

Year:


    Me!txtdatefrom = CDate("01/01/" & Year(Date))
    Me!txtDateTo = DateAdd("d", -1, DateAdd("yyyy", 1, Me!txtdatefrom))

Any advice would be great!\

Thank you
Art
Sioux Falls, SD


__._,_.___

Posted by: dbalorenzini@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar