PC Review


Reply
Thread Tools Rate Thread

DSum function criteria using between

 
 
=?Utf-8?B?TWFyaw==?=
Guest
Posts: n/a
 
      14th Dec 2005
Hello all,

I need to get a sum between a date range. I am using to varibles on date to
do this, but haven't found the correct syntax yet. What am I doing wrong?
vSDate and vEDate are my varibles.

vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", "[dtimemod] between
vSDate and vEDate")
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      14th Dec 2005
It is not the between that is the problem, it is that the variables you are
referencing are inside the quotes. Try this:
vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", & _
"[dtimemod] between " & vSDate & " and " & vEDate & "")
The above syntax is if the variables vSDate and vEDate are date type
varialbes. If they are textbox values, then they have to be considered
strings and delimited with # so they will be seen as dates
vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", & _
"[dtimemod] between #" & vSDate & "# and #" & vEDate & "#")

"Mark" wrote:

> Hello all,
>
> I need to get a sum between a date range. I am using to varibles on date to
> do this, but haven't found the correct syntax yet. What am I doing wrong?
> vSDate and vEDate are my varibles.
>
> vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", "[dtimemod] between
> vSDate and vEDate")

 
Reply With Quote
 
 
 
 
Tim Ferguson
Guest
Posts: n/a
 
      15th Dec 2005
=?Utf-8?B?S2xhdHV1?= <(E-Mail Removed)> wrote in
news:F6F0F49F-DA4B-4D5A-B6F7-(E-Mail Removed):

> vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", & _
> "[dtimemod] between #" & vSDate & "# and #" & vEDate & "#")
>


This is, of course, not safe for the rest of the world that does not use
USAian dates.


Tim F


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple DSUM criteria (MONTH & a numeric value) between worksheet sarah Microsoft Excel Worksheet Functions 4 17th Oct 2008 04:44 AM
example using DSUM worksheet function in a VBA function =?Utf-8?B?ZXhjZWxtYW4=?= Microsoft Excel Programming 3 9th Feb 2006 06:28 PM
DSum of the DSum =?Utf-8?B?YW4=?= Microsoft Access Forms 2 18th Jul 2005 02:03 PM
Re: Criteria not working in DSum function Allen Browne Microsoft Access VBA Modules 3 15th Jul 2004 12:18 AM
DSUM between criteria andym Microsoft Excel Worksheet Functions 3 27th Jun 2004 09:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:57 PM.