Re: Trying to use Year as a variable
From: MGFoster (me_at_privacy.com)
Date: 03/15/04
- Next message: John Viescas: "Re: Trying to get the last 12mths sum of sales"
- Previous message: MGFoster: "Re: Update or Append Help with Criteria"
- In reply to: Anthony Viscomi: "Trying to use Year as a variable"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 15 Mar 2004 23:32:10 GMT
Anthony Viscomi wrote:
> I am creating an Update Query that will filter by 2 dates using a Between
> Statement. I have the Month & Days "hard coded" in as the criteria, but I
> want the Year to be read in from an active form that contains the "year"
> fiield. I thought that it should look like this:
> Between 01/01 Forms![frmYear_Selector]![Combo0] and 01/31/
> Forms![frmYear_Selector]![Combo0]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Should be:
Between CDate("01/01" & Forms![frmYear_Selector]![Combo0]) and
CDate("01/31/" & Forms![frmYear_Selector]![Combo0])
You have to turn a string into a date. Using CDate() (convert to
date) accomplishes that....assuming that the Combo0 returns a valid
integer year value.
- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQFY9AYechKqOuFEgEQJllgCff6YXOzRw8iS0/f0g+BWisuuqX5QAnj6e
pMV6bhOFwiBjr9KzDG9++0/3
=fGNi
-----END PGP SIGNATURE-----
--
- Next message: John Viescas: "Re: Trying to get the last 12mths sum of sales"
- Previous message: MGFoster: "Re: Update or Append Help with Criteria"
- In reply to: Anthony Viscomi: "Trying to use Year as a variable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|