Access data datatype (1 Viewer)

Cladback

New member
Local time
Today, 10:58
Joined
Feb 11, 2016
Messages
1
Right so i spent 3 days at work to get my data in the correct format to upload into the database

fortunatly it pushed in with out errors

but the Date had to be forced in as text, then changed to date time in design view


now when i query the database on a date condition it wont work

i.e where date = 04/01/2015 but i get nothing even though i can locate the exact line myself in spreadsheet view its not my syntax its something to do with how its handeling the date how can i fix this


even where date between "01/01/2015" and "31/01/2015"

still nothing
 

boerbende

Ben
Local time
Today, 11:58
Joined
Feb 10, 2013
Messages
339
As far as I know you'll have to use # around your date
date = 04/01/2015
Should be
date = "#" & Format(04/01/2015, "mm\/dd\/yyyy") & "# "

Or even

date = Format(04/01/2015, "#mm\/dd\/yyyy#")
 

JHB

Have been here a while
Local time
Today, 11:58
Joined
Jun 17, 2012
Messages
7,732
..
now when i query the database on a date condition it wont work
...
Show the SQL-string of the query.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 19:58
Joined
Jan 20, 2009
Messages
12,851
Date needs to be formatted #mm/dd/yyyy#

where date = #1/4/2015#
where date between #1/1/2015# and #1/31/2015#
 

Users who are viewing this thread

Top Bottom