Avatar of FCapo
FCapo
 asked on

vb.net Date

Hi,

I have a binding source and I'd like to filter a set or records only in the current week based on today's date. for example, today is the 1st of July, I'd like to see all the records between Monday the 29th of June and Friday the 3rd of july.

thank you
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
Shaun Kline

8/22/2022 - Mon
Robberbaron (robr)

it depends upon your underlying tables somewhat.


    source1.Filter = "DateField BETWEEN '" & Date1.tostring("yyyy/mmm/dd") & "' AND '"  & Date2.ToString("yyyy/mmm/dd") & "'"



https://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.filter(v=vs.110).aspx
ASKER CERTIFIED SOLUTION
Shaun Kline

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck