Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter query in visual basic

Status
Not open for further replies.

osi2301

Programmer
Jul 3, 2004
75
AU
Is there any way to write query a date range in visual basic? I have a date range from thats called beginning date and ending date. I want to be able to determine if a specified date falls within the date range. Is there any way to do this in visual basic. Can BETWEEN be used in VB just as its used in a query? I have tried this expression but of course it doesn't work:
if [leavestart] = between [beginningdate] and [endingdate]then.
I know this doesn't work but its an example of what I would like to accomplish.
 
How are ya osi2301 . . .
osi2301 said:
[blue]Is there any way to write query a date range in visual basic?[/blue]
Not to my knowledge . . . but there is the forever known:
Code:
[blue]   If ([leavestart]>=[beginningdate]) And ([leavestart]<= endingdate]) Then[/blue]

Calvin.gif
See Ya! . . . . . .
 
Ok, thanks. I already had that coded. I just wasn't sure if another simplier method may have been available.

Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top