• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 130
  • Last Modified:

Getting a date

VB5
I have Access database linked table to Excel
And field called date, datatype date ( d,mmm)
it is like written in column  8-jul
Script in VB5
"Select Sum(amount) from TableA Where date between '01-Jul' and '30-Jul'"
fails  
Error message 3464 date dype mismatch
Please help to write correct script
Thanks
Matt

0
mativare
Asked:
mativare
1 Solution
 
yronnenCommented:
You should write it like that:
"Select Sum(amount) from TableA Where date between #01-Jul# and #30-Jul#"

Besides, it's better to convert the dates to mm/dd/yyyy. This will assure that you'll have no problems in the SQL
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now