Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
using between for date range
Old 03-20-2008, 11:20 AM using between for date range
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Ok,
I've racked my brain. Tried to figure this out.. Help...!

Trying to figure out how to retrieve info within a date range. Here is what I'm doing

Code:
Dim dDateFrom
dDateFrom=FormatDateTime(1/1/2008,2) 
Dim dDateTo
dDateTo=FormatDateTime(1/20/2008,2)
 
strQ1 = "SELECT *"
strQ1 = strQ1 & " FROM smeTracking"
strQ1 = strQ1 & " WHERE smTrDate BETWEEN " & dDateFrom & " AND " & dDateTo
strQ1 = strQ1 & " ORDER BY smTrDate"
strQ1 = strQ1 & ";"
objRS1.Open strQ1
No Errors. Just no results...

What's interesting is that when I change to NOT BETWEEN... All the records show.!?

What am I missing here!?


Thanks for any assistance.

CHip

Last edited by ChipJohns; 03-20-2008 at 11:21 AM..
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
 
Register now for full access!
Old 03-20-2008, 01:30 PM Re: using between for date range
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
And it works!

Code:
Dim dDateFrom
dDateFrom=#01/21/2008# 
Dim dDateTo
dDateTo=#01/25/2008#
strQ1 = "SELECT *"
strQ1 = strQ1 & " FROM smeTracking"
strQ1 = strQ1 & " WHERE smTrDate>=#" &  dDateFrom
strQ1 = strQ1 & "#" & " AND smTrDate<=#" & dDateTo
strQ1 = strQ1 & "# ORDER BY smTrDate"
strQ1 = strQ1 & ";"
objRS1.Open strQ1
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-21-2008, 03:28 AM Re: using between for date range
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Microsoft Access?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 03-21-2008, 09:51 AM Re: using between for date range
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
YES!

How did you know
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-21-2008, 01:24 PM Re: using between for date range
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
He's a mind reader
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-21-2008, 03:58 PM Re: using between for date range
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Frosty is always reading my mind. I wish he'd stop. I think he got my ATM PIN number.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to using between for date range
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28593 seconds with 12 queries