Hi thanks for the response. Yes I think what I need is the integer value of
the first thursday of the month. I currently have read in the date as a
datetime type. Just wondering how to get the first day of the month?

Signature
Paul G
Software engineer.
> > HI I have a stored procedure that returns data with a date field in
> > the form
[quoted text clipped - 23 lines]
>
> Hans Kesting
Juan T. Llibre - 01 Aug 2007 16:15 GMT
re:
!> Just wondering how to get the first day of the month?
public static DateTime GetFirstDayInMonth(DateTime dt)
{
DateTime dtRet = new DateTime(dt.Year, dt.Month, 1, 0,0,0); return dtRet;
}
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> Hi thanks for the response. Yes I think what I need is the integer value of
> the first thursday of the month. I currently have read in the date as a
[quoted text clipped - 27 lines]
>>
>> Hans Kesting
Mark Rae [MVP] - 01 Aug 2007 16:16 GMT
> Hi thanks for the response. Yes I think what I need is the integer value
> of
> the first thursday of the month. I currently have read in the date as a
> datetime type. Just wondering how to get the first day of the month?
DateTime dtmToday = DateTime.Now;
DateTime dtmFirstOfMonth = new DateTime(dtmToday.Year, dtmToday.Month, 1);

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Paul - 01 Aug 2007 18:36 GMT
Thanks for the replies, it works!

Signature
Paul G
Software engineer.
> > Hi thanks for the response. Yes I think what I need is the integer value
> > of
[quoted text clipped - 3 lines]
> DateTime dtmToday = DateTime.Now;
> DateTime dtmFirstOfMonth = new DateTime(dtmToday.Year, dtmToday.Month, 1);
Mark Rae [MVP] - 01 Aug 2007 18:50 GMT
> Thanks for the replies, it works!
DateTime dtmToday = DateTime.Now;
DateTime dtmFirstOfMonth = new DateTime(dtmToday.Year, dtmToday.Month, 1);
DateTime dtmFirstThursday = dtmFirstOfMonth;
while (dtmFirstThursday.DayOfWeek != DayOfWeek.Thursday)
{
dtmFirstThursday = dtmFirstThursday.AddDays(1);
}

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net