MLH wrote:
If I choose to dim MyDate as Date or MyDate as Variant,
what is the most significant difference between the two
choices?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Date data type takes up 8 bytes in memory/storage and Variant can take
up to 16 bytes for numerics (that includes dates, since a date is stored
as a Double).
It's better to use a Date data type if you know that the data will
always be a date. I usually use Variants when I'm not sure if the
returned value from a query will be NULL or the data type I expect.
E.g.:
Dim varReturn As Variant
' run a routine that returns the result of a query:
varReturn = getQueryResult("query_name","param1","param_value" )
If IsNull(varReturn) Then
MsgBox "No Data Fits Your Criteria"
Else
' do something w/ the returned value
End If
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQtFnhoechKqOuFEgEQKCUACgi/eDbd0MOiwayA02tG2sn09dghUAoPLU
I7L6mkiZUM7HAM8dw6Yq97GY
=xRKd
-----END PGP SIGNATURE-----