473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Detecting that date is on the same week or last week.

Hello,

I have to DateTime structure, how do I calculate if date A is on the same
week with date B or last week of date B?

Thanks,

Hadi
Nov 15 '05 #1
1 7678
if ( a. AddDays( 7- a.DayOfWeek ).Date.Equals(b.AddDays(
7-b.DayOfWeek ).Date) )

{

// their int the same week

}

else if ( a. AddDays( 7-
a.DayOfWeek ).Date.Equals(b.AddDays( -b.DayOfWeek ).Date) ){

// a is in the last week of b
}

Hope this help.

"Hadi" <ha**@hadi.net> дÈëÏûÏ¢
news:O0**************@TK2MSFTNGP10.phx.gbl...
Hello,

I have to DateTime structure, how do I calculate if date A is on the same
week with date B or last week of date B?

Thanks,

Hadi

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: cg_news | last post by:
In short, what I am trying to do is, based on a date, calculate the week of year (as described in ISO 8601), then calculate the first and last date in this week period and return them in the format...
7
by: Garyrek | last post by:
Hi I have a requirement where I need to make a report for each auto dealer how many hits they got on specified date range, so for each car detail page I increment the counter and total it while...
5
by: Alicia | last post by:
Yes, but will that skip a week and group by the date for me? I basically wanted something that would do a count of the dates, then group them by their week name.. BEFORE: Resource Date ...
1
by: Vanessa | last post by:
Does anyone know whether when I select a weeknumber of a certain year, eg. 2004, the date from first day to the last day of the week will be known. Regards Vanessa
2
by: Agnes | last post by:
Does .net provide any function for such purpose ? e.g today is 21-10-2004, the week is 43, now I want to get the DATE with (week 42, Monday) Thanks alot
0
by: Lee Harr | last post by:
I wrote a function to return the first date of a given week (and a few related functions) : -- return the first date in the given week CREATE or REPLACE FUNCTION week_start(integer, integer)...
5
by: amanda27 | last post by:
I have a database that we use in our department for the status of our projects. In the form when you pick a project from the dropdown list I have a subform that pulls the data entered for the...
5
by: bruce24444 | last post by:
I have a database which assigns warranty claims to people with a main screen showing number of files assigned to each person. The number assigned shows day, week, month and year numbers so they can...
5
slifland
by: slifland | last post by:
I am trying to make a appointment book for a access 2003 database. I would like the report to display the title "Appointments for "month day" - "month day" "year" What I have so far doesn’t do...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.