473,216 Members | 1,477 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,216 software developers and data experts.

First Day of the Month

I was wondering how to get the first day of the month as a datetime value. I don't want to set the date to a specified format because I want to display it, the way the user has it set on their machine.

Thanks
Jeff
Nov 20 '05 #1
6 15851
Cor
Hi Jeff,

Mostly the first day of the month is day

"1" & now.month & now.year

Was you looking for that?.

Cor
I was wondering how to get the first day of the month as a datetime value.

I don't want to set the date to a specified format because I want to display
it, the way the user has it set on their machine.

Nov 20 '05 #2
Jeff,

Try using
-------------------------------

Dim dtNow As Date = Date.Now
Dim dtFirstOfMonth As Date = dtNow.AddDays(-dtNow.Day + 1)

-------------------------------

HTH,

Trev.

"Jeff" <an*******@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...
I was wondering how to get the first day of the month as a datetime value. I don't want to set the date to a specified format because I want to display
it, the way the user has it set on their machine.
Thanks
Jeff

Nov 20 '05 #3
That was exactly what I was looking for

Thank you

----- Trev Hunter wrote: ----

Jeff

Try usin
------------------------------

Dim dtNow As Date = Date.No
Dim dtFirstOfMonth As Date = dtNow.AddDays(-dtNow.Day + 1

------------------------------

HTH

Trev

"Jeff" <an*******@discussions.microsoft.com> wrote in messag
news:AD**********************************@microsof t.com..
I was wondering how to get the first day of the month as a datetime value

I don't want to set the date to a specified format because I want to displa
it, the way the user has it set on their machine
Thank

Jef


Nov 20 '05 #4
* "=?Utf-8?B?SmVmZg==?=" <an*******@discussions.microsoft.com> scripsit:
I was wondering how to get the first day of the month as a datetime
value. I don't want to set the date to a specified format because I want
to display it, the way the user has it set on their machine.


\\\
Dim d As New DateTime(1999, 12, 1)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Cor
Hi Herfried,

I make from our 2 answers one.

\\\
Dim d As New DateTime(now.year, now.month, 1)
///


:-)

Cor
Nov 20 '05 #6
Cor,

* "Cor" <no*@non.com> scripsit:
I make from our 2 answers one.

\\\
Dim d As New DateTime(now.year, now.month, 1)
///


:-)


:-)

P.S.: I was not sure if I understood the OP's question when
posting my reply.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

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

Similar topics

3
by: johkar | last post by:
I need to document.write out a select list populated with the dates for the first and third Wednesday of each month. How do I get to the actual days? <select name="mySelect"> <option value="Oct...
6
by: Ante Perkovic | last post by:
Hi, How to declare datetime object and set it to my birthday, first or last day of this month or any other date. I can't find any examples in VS.NET help! BTW, what is the difference...
2
by: bb | last post by:
any way to prevent displaying the previous and next months in the calendar control? i have tried just blanking the text out in the dayrender IsOtherMonth and also dynamically changing the...
3
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where...
0
by: larry | last post by:
I am in the process of rewriting one of my first PHP scripts, an event calendar, and wanted to share the code that is the core of the new calendar. My current/previous calendar processed data...
3
by: remya1000 | last post by:
i'm using ASP with MSAccess as database. i have two buttons and two textbox in my page. when i press my first button (First month) i need to display the current month in one textbox and last one...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
HI I have a stored procedure that returns data with a date field in the form of a DateTime type. I need to place data in variables based on days of the week starting with the first thursday of the...
4
by: Chris Gilpin | last post by:
Hey everybody. I have two tables. The first table lists all of the client ids of the clients I am interested in analyzing. The second table lists various data from their different visits to the...
2
by: ncsthbell | last post by:
I am having problems getting the end date to calculate correctly. I start with Quarter '03/02', (YY/QTR), for this it means it is for the 2nd qtr of 2003. My goal is to get the begin & end dates...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.