hello,..

I want to know how to show date on Sunday, for example, I entered into by date
In other words I chose on Sunday, for example, for a period of one month from the start date I entered into
For example, when I say on Sunday from the beginning of Day 1 in August for a month
After that displays all the dates on Sunday in the period

please help me
thank for all you,..

Use DayOfWeek in your start date (has to be datetime).

dim start_date as new datetime(2011,07,30)
msgbox( start_date.dayofweek)

You'll get an integer back showing what day is your start date (1= Monday, 2= Tuesday, ... 7 = Sunday)

Add to your start date the result of 7 - start_date.dayofweek and you'll get the first Sunday after the start date. Keep adding 7 days to that date to get all the Sundays.
Remeber to stop when the date you are currently processing is greater than your end date.

ok but how i can show it
and i want to set it manualy it means i want to show sunday date
from 1/07/2011 to 20/08/2011
how i can inter and show it

Where do you want to show it? On a DataGrid? On a listview ? On a textbox with commas between each date ?
You have to decide for yourself, build it and let us know if you are having problems.

PS: I believe it would be easier to show the dates on a listview.

i want to show it in dbgrid
can you tell me how to do it with set it manual y as i say
please help

dbgrid?
Can you tell a more please? Why you are all so shy?
Dont expect any help with this kind of manner guys.

Mitja is right, you need to share your code.
Even if you don't know how to show the result in a datagrid, you must try.

To give you a hint, use a while loop that checks that the date you are currently processing + 7 days is not bigger than your end date. If it is not change the date to the new value and add a record to your datagrid.

look adam i just want to know
in these code you wrote it

VB.NET Syntax (Toggle Plain Text)
dim start_date as new datetime(2011,07,30)
msgbox( start_date.dayofweek)

why you wrote the date (30,07,2011)
i want to chose or write it manual and show the date of day which i chose in datagrid or anay thing
now you under stand me

The code I wrote was just a demonstration on how to use the dayofweek.

I needed a date to use dayofweek and since the day I posted that was July 30th, I've used that date.
Just make sure that you are using dayofweek with a datetime var and assign your datetime any date you like.

PS: Any progress so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.