This is a multi-part message in MIME format.

------=_NextPart_000_0017_01C02930.A6560C40
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am running a query to grab values from my db between a range of dates. =
the only problem is that it only seems to grab the values from first =
date, can someone tell me how I can get dates between the dates picked =
on my form using this query?

SELECT dt_OrderHistoryHeader.*
FROM
dt_OrderHistoryHeader,dt_ShipToAddr
WHERE
dt_OrderHistoryHeader.BusinessunitFK =3D #BusinessUnit#
AND
dt_OrderHistoryHeader.ShiptoAddrFK =3D dt_ShiptoAddr.ShiptoAddrID
 AND
dt_ShipToAddr.ShiptoAddrID in (SELECT ShipToAddrID from
dt_ShipToAddr
WHERE
dt_ShiptoAddr.ShiptoAddrID =3D dt_OrderHistoryHeader.ShiptoAddrFK)
AND
DATEVALUE(MID$(dt_OrderHistoryHeader.OrderHistoryDate,3,2)+'/'+
MID$(dt_OrderHistoryHeader.OrderHistoryDate,1,2)+'/'+
MID$(dt_OrderHistoryHeader.OrderHistoryDate,5,4)) >=3D =
DATEVALUE('#orderhistoryStartDate#')
AND
DATEVALUE(MID$(dt_OrderHistoryHeader.OrderHistoryDate,3,2)+'/'+
MID$(dt_OrderHistoryHeader.OrderHistoryDate,1,2)+'/'+
MID$(dt_OrderHistoryHeader.OrderHistoryDate,5,4)) < =
DATEVALUE('#orderhistoryEndDate#')

Thanks
Ben Densmore

------=_NextPart_000_0017_01C02930.A6560C40
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am running a query to grab values =
from my db=20
between a range of dates. the only problem is that it only seems to grab =
the=20
values from first date, can someone tell me how I can get dates between =
the=20
dates picked on my form using this query?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SELECT=20
dt_OrderHistoryHeader.*<BR>FROM<BR>dt_OrderHistoryHeader,dt_ShipToAddr<BR=
>WHERE<BR>dt_OrderHistoryHeader.BusinessunitFK=20
=3D #BusinessUnit#<BR>AND<BR>dt_OrderHistoryHeader.ShiptoAddrFK =3D=20
dt_ShiptoAddr.ShiptoAddrID<BR>&nbsp;AND<BR>dt_ShipToAddr.ShiptoAddrID in =
(SELECT=20
ShipToAddrID =
from<BR>dt_ShipToAddr<BR>WHERE<BR>dt_ShiptoAddr.ShiptoAddrID =3D=20
dt_OrderHistoryHeader.ShiptoAddrFK)<BR>AND<BR>DATEVALUE(MID$(dt_OrderHist=
oryHeader.OrderHistoryDate,3,2)+'/'+<BR>MID$(dt_OrderHistoryHeader.OrderH=
istoryDate,1,2)+'/'+<BR>MID$(dt_OrderHistoryHeader.OrderHistoryDate,5,4))=
=20
&gt;=3D=20
DATEVALUE('#orderhistoryStartDate#')<BR>AND<BR>DATEVALUE(MID$(dt_OrderHis=
toryHeader.OrderHistoryDate,3,2)+'/'+<BR>MID$(dt_OrderHistoryHeader.Order=
HistoryDate,1,2)+'/'+<BR>MID$(dt_OrderHistoryHeader.OrderHistoryDate,5,4)=
)=20
&lt; DATEVALUE('#orderhistoryEndDate#')</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Ben Densmore</FONT></DIV></BODY></HTML>

------=_NextPart_000_0017_01C02930.A6560C40--

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to