Click here to Skip to main content
15,903,201 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to rename texts in a Standart Browse File / Browse Folder Dialog Pin
Eddy Vluggen22-Jul-15 21:40
professionalEddy Vluggen22-Jul-15 21:40 
QuestionA validation information inside a zip file Pin
satc22-Jul-15 2:43
satc22-Jul-15 2:43 
AnswerRe: A validation information inside a zip file Pin
Eddy Vluggen22-Jul-15 3:51
professionalEddy Vluggen22-Jul-15 3:51 
AnswerRe: A validation information inside a zip file Pin
Dave Kreskowiak22-Jul-15 3:53
mveDave Kreskowiak22-Jul-15 3:53 
GeneralRe: A validation information inside a zip file Pin
satc26-Jul-15 0:11
satc26-Jul-15 0:11 
GeneralRe: A validation information inside a zip file Pin
Dave Kreskowiak26-Jul-15 3:39
mveDave Kreskowiak26-Jul-15 3:39 
QuestionHelp with datetime Pin
jkirkerx21-Jul-15 10:58
professionaljkirkerx21-Jul-15 10:58 
AnswerRe: Help with datetime Pin
Dave Kreskowiak21-Jul-15 11:56
mveDave Kreskowiak21-Jul-15 11:56 
Then easy way to do it is to just assemble the DateTime from Month, Day 1, Year, 00:00:00 (midnight), like you have in your first line of code.

The end DateTime is actually very easy. Just create a DateTime for the Month + 1, Day 1, Year, 00:00:00 (midnight).

For example,
' Get the current Date/Time in a variable we can manpulate consistently
' This is because each call to DateTime.Now or DateTime.Today will return
' a different time, and if executed at midnight, different days!
Dim baseDate As DateTime = DateTime.Today()

' Build a start date based on the current month and year.
Dim startDate As DateTime = New DateTime(baseDate.Year, baseDate.Month, 1, 0, 0, 0, 0)

' Build a end date based on the current month and year.
' Add a month to the current DateTime to easier get the end date.
' This also accounts for rolling over the year.
baseDate = baseDate.AddMonth(1)
Dim stopDate = New DateTime(baseDate.Year, baseDate.Month, 1, 0, 0, 0, 0)

Now, in your query the WHERE clause would look like this:
WHERE dateTime >= startDate AND dateTime < endDate

This accounts for records that appear from midnight on the start day and up to, but not inclusive of, the end date which starts at midnight.
A guide to posting questions on CodeProject

Click this: Asking questions is a skill.
Seriously, do it.

Dave Kreskowiak

GeneralRe: Help with datetime Pin
jkirkerx21-Jul-15 13:05
professionaljkirkerx21-Jul-15 13:05 
SuggestionRe: Help with datetime Pin
Ralf Meier21-Jul-15 21:28
mveRalf Meier21-Jul-15 21:28 
SuggestionRe: Help with datetime Pin
Richard Deeming22-Jul-15 1:40
mveRichard Deeming22-Jul-15 1:40 
GeneralRe: Help with datetime Pin
jkirkerx22-Jul-15 6:00
professionaljkirkerx22-Jul-15 6:00 
QuestionVb.net - Datagridview not populated Pin
Marcus Genovese16-Jul-15 23:45
Marcus Genovese16-Jul-15 23:45 
AnswerRe: Vb.net - Datagridview not populated Pin
Simon_Whale17-Jul-15 0:31
Simon_Whale17-Jul-15 0:31 
GeneralRe: Vb.net - Datagridview not populated Pin
Marcus Genovese17-Jul-15 0:43
Marcus Genovese17-Jul-15 0:43 
QuestionAttempted to read or write protected memory. This is often an indication that other memory is corrupt in vb.net Pin
melbin mp16-Jul-15 3:58
melbin mp16-Jul-15 3:58 
AnswerRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt in vb.net Pin
Wes Aday16-Jul-15 4:37
professionalWes Aday16-Jul-15 4:37 
AnswerRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt in vb.net Pin
Dave Kreskowiak16-Jul-15 15:53
mveDave Kreskowiak16-Jul-15 15:53 
QuestionIEnumerable(of, DateTime, ToString Format Pin
jkirkerx13-Jul-15 10:56
professionaljkirkerx13-Jul-15 10:56 
AnswerRe: IEnumerable(of, DateTime, ToString Format Pin
Dave Kreskowiak13-Jul-15 12:04
mveDave Kreskowiak13-Jul-15 12:04 
GeneralRe: IEnumerable(of, DateTime, ToString Format Pin
jkirkerx13-Jul-15 12:25
professionaljkirkerx13-Jul-15 12:25 
QuestionNeed to talk to USB serial adapter but no port data available on laptop Pin
KarltheSaabNut13-Jul-15 5:37
professionalKarltheSaabNut13-Jul-15 5:37 
AnswerRe: Need to talk to USB serial adapter but no port data available on laptop Pin
Michael_Davies13-Jul-15 5:48
Michael_Davies13-Jul-15 5:48 
GeneralRe: Need to talk to USB serial adapter but no port data available on laptop Pin
KarltheSaabNut13-Jul-15 6:13
professionalKarltheSaabNut13-Jul-15 6:13 
GeneralRe: Need to talk to USB serial adapter but no port data available on laptop Pin
Michael_Davies13-Jul-15 6:19
Michael_Davies13-Jul-15 6:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.