A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

append date records with no time



 
 
Thread Tools Display Modes
  #1  
Old July 1st, 2009, 07:46 PM posted to microsoft.public.access
javablood
external usenet poster
 
Posts: 84
Default append date records with no time

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,
--
javablood
  #2  
Old July 1st, 2009, 09:08 PM posted to microsoft.public.access
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default append date records with no time

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" wrote:

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,
--
javablood

  #3  
Old July 1st, 2009, 10:11 PM posted to microsoft.public.access
John Spencer MVP
external usenet poster
 
Posts: 533
Default append date records with no time

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 DEWEY wrote:
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" wrote:

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,
--
javablood

  #4  
Old July 2nd, 2009, 12:35 PM posted to microsoft.public.access
javablood
external usenet poster
 
Posts: 84
Default append date records with no time

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


"John Spencer MVP" wrote:

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 DEWEY wrote:
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" wrote:

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,
--
javablood


  #5  
Old July 2nd, 2009, 12:36 PM posted to microsoft.public.access
javablood
external usenet poster
 
Posts: 84
Default append date records with no time

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


"John Spencer MVP" wrote:

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 DEWEY wrote:
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" wrote:

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,
--
javablood


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.