append date records with no time

J

javablood

I have set the input mask on a table to short date and the format as
mm/dd/yyyy so that when I append records from another table (supplied from an
outside source) I only get date values. However, this is not working as I am
still getting the time values. I realize that time will always be there but
I run some queries so that I get unique dates and if the time is there it
will not work, unless of course the time is alwasy midnight.

I also tried to update with datevalue but Access did not like it. Any help
is appreciated.

Thanks,
 
K

KARL DEWEY

Use DateValue in your select query to remove time like this --
MyDate: DateValue([YourDate])
This way they will compare and the time is unaltered for when you need it.
 
J

John Spencer MVP

That works unless you try using DateValue with a null value. So it is safer
to use something like:
IIF(IsDate([SomeField]),DateValue([SomeField]),Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

KARL said:
Use DateValue in your select query to remove time like this --
MyDate: DateValue([YourDate])
This way they will compare and the time is unaltered for when you need it.

javablood said:
I have set the input mask on a table to short date and the format as
mm/dd/yyyy so that when I append records from another table (supplied from an
outside source) I only get date values. However, this is not working as I am
still getting the time values. I realize that time will always be there but
I run some queries so that I get unique dates and if the time is there it
will not work, unless of course the time is alwasy midnight.

I also tried to update with datevalue but Access did not like it. Any help
is appreciated.

Thanks,
 
J

javablood

Thank you Karl and John. It worked and I also saw the error of my ways in my
append query!
--
javablood


John Spencer MVP said:
That works unless you try using DateValue with a null value. So it is safer
to use something like:
IIF(IsDate([SomeField]),DateValue([SomeField]),Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

KARL said:
Use DateValue in your select query to remove time like this --
MyDate: DateValue([YourDate])
This way they will compare and the time is unaltered for when you need it.

javablood said:
I have set the input mask on a table to short date and the format as
mm/dd/yyyy so that when I append records from another table (supplied from an
outside source) I only get date values. However, this is not working as I am
still getting the time values. I realize that time will always be there but
I run some queries so that I get unique dates and if the time is there it
will not work, unless of course the time is alwasy midnight.

I also tried to update with datevalue but Access did not like it. Any help
is appreciated.

Thanks,
 
J

javablood

Thank you Karl and John. It worked and I also saw the error of my ways with
my append query!
--
javablood


John Spencer MVP said:
That works unless you try using DateValue with a null value. So it is safer
to use something like:
IIF(IsDate([SomeField]),DateValue([SomeField]),Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

KARL said:
Use DateValue in your select query to remove time like this --
MyDate: DateValue([YourDate])
This way they will compare and the time is unaltered for when you need it.

javablood said:
I have set the input mask on a table to short date and the format as
mm/dd/yyyy so that when I append records from another table (supplied from an
outside source) I only get date values. However, this is not working as I am
still getting the time values. I realize that time will always be there but
I run some queries so that I get unique dates and if the time is there it
will not work, unless of course the time is alwasy midnight.

I also tried to update with datevalue but Access did not like it. Any help
is appreciated.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top