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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

removing spaces



 
 
Thread Tools Display Modes
  #1  
Old November 25th, 2008, 05:25 PM posted to microsoft.public.access.queries
John
external usenet poster
 
Posts: 2,649
Default removing spaces

I have a query that has a date and time field. What I would like to do is
read the only the date, for example; 11/12/2008 12:34:67pm. I tried this
test1: left([orderdate1], 10) and I would get back something like 11/12/2008
1. So what I would like to do is read up to the space.
  #2  
Old November 25th, 2008, 05:46 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default removing spaces

Try to not use a text/string function (Left()) on a numeric or date
field/value. If you want the date part only, use the DateValue() function to
set the time part to 0.

--
Duane Hookom
Microsoft Access MVP


"John" wrote:

I have a query that has a date and time field. What I would like to do is
read the only the date, for example; 11/12/2008 12:34:67pm. I tried this
test1: left([orderdate1], 10) and I would get back something like 11/12/2008
1. So what I would like to do is read up to the space.

  #3  
Old November 25th, 2008, 05:59 PM posted to microsoft.public.access.queries
fredg
external usenet poster
 
Posts: 4,386
Default removing spaces

On Tue, 25 Nov 2008 09:25:02 -0800, John wrote:

I have a query that has a date and time field. What I would like to do is
read the only the date, for example; 11/12/2008 12:34:67pm. I tried this
test1: left([orderdate1], 10) and I would get back something like 11/12/2008
1. So what I would like to do is read up to the space.


Your working too hard.
DisplayDateOnlyateValue([DateField])

or you could use

DisplayDateOnly:Format([DateField],"mm/dd/yyyy")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




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 07:38 PM.


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