Formatting date fields

I could not seem to find the format syntax.
I want to format a date field to display '------' when there is no date 
to print in a record.
Can this be done?
0
BobC
3/5/2008 12:05:03 AM
access.reports 4434 articles. 0 followers. Follow

7 Replies
691 Views

Similar Articles

[PageSpeed] 0

If no-one has a better suggestion then you can create a second field in your
query with iif(IsNull(MyDate),Format(MyDate,"dd/mm/yy"),"----"). Show this
field for display purposes and keep the real field for sorting and
calculations.
Evi
"BobC" <Bob.NoSpammm@cox.net> wrote in message
news:Kslzj.16736$097.15342@newsfe21.lga...
> I could not seem to find the format syntax.
> I want to format a date field to display '------' when there is no date
> to print in a record.
> Can this be done?


0
Evi
3/5/2008 12:19:49 AM
Actually, the Format property allows for up to 4 different formats to be 
specified (one for positive values, one for negative values, one for values 
of zero and one for values of Null). Since "no date" must correspond to a 
Null value, try the following Format:

yyyy\-mm\-dd;;;\-\-\-\-

(yes, there are three semi-colons in a row there)

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Evi" <evwool@TakeThisOutntlworld.com> wrote in message 
news:FGlzj.32170$St5.25673@newsfe1-gui.ntli.net...
> If no-one has a better suggestion then you can create a second field in 
> your
> query with iif(IsNull(MyDate),Format(MyDate,"dd/mm/yy"),"----"). Show this
> field for display purposes and keep the real field for sorting and
> calculations.
> Evi
> "BobC" <Bob.NoSpammm@cox.net> wrote in message
> news:Kslzj.16736$097.15342@newsfe21.lga...
>> I could not seem to find the format syntax.
>> I want to format a date field to display '------' when there is no date
>> to print in a record.
>> Can this be done?
>
> 


0
Douglas
3/5/2008 12:48:05 AM
A neat approach!
Thanks!
Bob

Evi wrote:
> If no-one has a better suggestion then you can create a second field in your
> query with iif(IsNull(MyDate),Format(MyDate,"dd/mm/yy"),"----"). Show this
> field for display purposes and keep the real field for sorting and
> calculations.
> Evi
> "BobC" <Bob.NoSpammm@cox.net> wrote in message
> news:Kslzj.16736$097.15342@newsfe21.lga...
>> I could not seem to find the format syntax.
>> I want to format a date field to display '------' when there is no date
>> to print in a record.
>> Can this be done?
> 
> 
0
BobC
3/5/2008 1:28:08 AM
Use Douglas's suggestion, it will be better. It won't change your date field
into text.
Evi
"BobC" <Bob.NoSpammm@cox.net> wrote in message
news:DGmzj.16740$097.12189@newsfe21.lga...
>
> A neat approach!
> Thanks!
> Bob
>
> Evi wrote:
> > If no-one has a better suggestion then you can create a second field in
your
> > query with iif(IsNull(MyDate),Format(MyDate,"dd/mm/yy"),"----"). Show
this
> > field for display purposes and keep the real field for sorting and
> > calculations.
> > Evi
> > "BobC" <Bob.NoSpammm@cox.net> wrote in message
> > news:Kslzj.16736$097.15342@newsfe21.lga...
> >> I could not seem to find the format syntax.
> >> I want to format a date field to display '------' when there is no date
> >> to print in a record.
> >> Can this be done?
> >
> >


0
Evi
3/5/2008 6:40:51 AM
Doug, what do the \ between the dashes do?
Evi

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:ek10TqlfIHA.1132@TK2MSFTNGP06.phx.gbl...
> Actually, the Format property allows for up to 4 different formats to be
> specified (one for positive values, one for negative values, one for
values
> of zero and one for values of Null). Since "no date" must correspond to a
> Null value, try the following Format:
>
> yyyy\-mm\-dd;;;\-\-\-\-
>
> (yes, there are three semi-colons in a row there)
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Evi" <evwool@TakeThisOutntlworld.com> wrote in message
> news:FGlzj.32170$St5.25673@newsfe1-gui.ntli.net...
> > If no-one has a better suggestion then you can create a second field in
> > your
> > query with iif(IsNull(MyDate),Format(MyDate,"dd/mm/yy"),"----"). Show
this
> > field for display purposes and keep the real field for sorting and
> > calculations.
> > Evi
> > "BobC" <Bob.NoSpammm@cox.net> wrote in message
> > news:Kslzj.16736$097.15342@newsfe21.lga...
> >> I could not seem to find the format syntax.
> >> I want to format a date field to display '------' when there is no date
> >> to print in a record.
> >> Can this be done?
> >
> >
>
>


0
Evi
3/5/2008 6:46:16 AM
\ is an escape character. It means that whatever follows is printed 
literally.

In the case of yyyy\-mm\-dd, if you were to put yyyy-mm-dd, you'd actually 
get whatever was defined as the date separator character in Regional 
Settings in place of the -. For the last bit, it simply means you get ----.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Evi" <evwool@TakeThisOutntlworld.com> wrote in message 
news:Ykrzj.33555$d62.11461@newsfe6-gui.ntli.net...
> Doug, what do the \ between the dashes do?
> Evi
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
> news:ek10TqlfIHA.1132@TK2MSFTNGP06.phx.gbl...
>> Actually, the Format property allows for up to 4 different formats to be
>> specified (one for positive values, one for negative values, one for
> values
>> of zero and one for values of Null). Since "no date" must correspond to a
>> Null value, try the following Format:
>>
>> yyyy\-mm\-dd;;;\-\-\-\-
>>
>> (yes, there are three semi-colons in a row there)
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "Evi" <evwool@TakeThisOutntlworld.com> wrote in message
>> news:FGlzj.32170$St5.25673@newsfe1-gui.ntli.net...
>> > If no-one has a better suggestion then you can create a second field in
>> > your
>> > query with iif(IsNull(MyDate),Format(MyDate,"dd/mm/yy"),"----"). Show
> this
>> > field for display purposes and keep the real field for sorting and
>> > calculations.
>> > Evi
>> > "BobC" <Bob.NoSpammm@cox.net> wrote in message
>> > news:Kslzj.16736$097.15342@newsfe21.lga...
>> >> I could not seem to find the format syntax.
>> >> I want to format a date field to display '------' when there is no 
>> >> date
>> >> to print in a record.
>> >> Can this be done?
>> >
>> >
>>
>>
>
> 


0
Douglas
3/5/2008 11:25:51 PM
Thanks Doug. That's great.
Evi

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:#9d1BhxfIHA.6136@TK2MSFTNGP03.phx.gbl...
> \ is an escape character. It means that whatever follows is printed
> literally.
>
> In the case of yyyy\-mm\-dd, if you were to put yyyy-mm-dd, you'd actually
> get whatever was defined as the date separator character in Regional
> Settings in place of the -. For the last bit, it simply means you
get ----.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Evi" <evwool@TakeThisOutntlworld.com> wrote in message
> news:Ykrzj.33555$d62.11461@newsfe6-gui.ntli.net...
> > Doug, what do the \ between the dashes do?
> > Evi
> >
> > "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
> > news:ek10TqlfIHA.1132@TK2MSFTNGP06.phx.gbl...
> >> Actually, the Format property allows for up to 4 different formats to
be
> >> specified (one for positive values, one for negative values, one for
> > values
> >> of zero and one for values of Null). Since "no date" must correspond to
a
> >> Null value, try the following Format:
> >>
> >> yyyy\-mm\-dd;;;\-\-\-\-
> >>
> >> (yes, there are three semi-colons in a row there)
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no private e-mails, please)
> >>
> >>
> >> "Evi" <evwool@TakeThisOutntlworld.com> wrote in message
> >> news:FGlzj.32170$St5.25673@newsfe1-gui.ntli.net...
> >> > If no-one has a better suggestion then you can create a second field
in
> >> > your
> >> > query with iif(IsNull(MyDate),Format(MyDate,"dd/mm/yy"),"----"). Show
> > this
> >> > field for display purposes and keep the real field for sorting and
> >> > calculations.
> >> > Evi
> >> > "BobC" <Bob.NoSpammm@cox.net> wrote in message
> >> > news:Kslzj.16736$097.15342@newsfe21.lga...
> >> >> I could not seem to find the format syntax.
> >> >> I want to format a date field to display '------' when there is no
> >> >> date
> >> >> to print in a record.
> >> >> Can this be done?
> >> >
> >> >
> >>
> >>
> >
> >
>
>


0
Evi
3/5/2008 11:33:05 PM
Reply:

Similar Artilces:

How to Change Language of Dates in Outlook Express
I work on the Occupied West Bank, but for some reason my computer thinks it's in South Africa and uses Afrikaans for the outgoing date in OE. I would like to change the language of OE to English, but I can't figure out how. The Help says to get a language encoding download from the Explorer homepage under international, but I can't find it. In any case, that doesn't seem to make a lot of sense, since all I am asking for is Microsoft's native language. I am just a regular user, so please be as clear as possible if you have any ideas. Thanks much, Katherine F...

negative number format
I have a report uploaded to excel from a particular program used here at work. In that program, negative numbers have the format of $###.00-, with the minus sign at the end instead of the beginning. When the data comes over to Excel the minus sign is still at the end of the number. The text currently has a General Format with No Specific Number Format. I have been manually moving the minus signs to the beginning in each cell, then changing the Column to Currency Number Format which is very time consuming. Is there a formula I can use in the Cell, Column and/or Worksheet containing...

Change date format to European format
My computer is set to European date format but Excel is default to American date format. Can someone advise how to change this default setting. Thanks, Scott Have you restarted Excel since setting the system date formatting? Excel takes its cue from the OS on launch. Also, double-check the Regional setting in the System Prefs. If those aren't the cause you'll need to be specific about your version & update levels of both Office & OS X plus any other details you can supply. -- HTH |:>) Bob Jones [MVP] Office:Mac "Scott" <NoSpam-Scot...

Required field added to existing records
Hello, I have a existing table with data already created. I need to add a field to this table that is going to be required from now on. When I open the form to update the record it allows me to add the information to the required field. But when I tested the record to see if it would flag me on the required field by closing it, it closes without flaging me to enter the information in the required field. Can I update existing records on a form for a newly added required field and have it flag me if the data is not enter on a form. Thanks, Robin You need to add the field to the table...

Formatting just some rows
Thank you so much for that, it'll save loadsa time. I adjusted the formula as the original sheet contined 11 columns of data. Can you help with this part now? The original sheet had dates in Column E (in the form Jan-03). Thay have come through on the new sheet in the single column as 5 digit figures such as 37622. Is there any way of getting the original form of the date back, affecting just rows 5, 16, 27 etc...of the new sheet? Perhaps I need to format just these rows on the NEW sheet. A similar problem exists with column I of the original where the � sign has been lost. Again is t...

Count Dates?
I have a range A1:A1500 where the cells have the custom date format of dd.mm.yy However, some cells contain text. I need a formula to COUNT the number of cells that contain dd.mm.yy dates. I was going to try an array SUM(IF(...1,0) which tested for LEN of 8 (the no. of characters in the date fields). But some of the text entries could also contain 8 characters. Can anyone advise how I can count the dates? Many thanks,.....Jason try =SUMPRODUCT((ISNUMBER(H2:H22))*1) -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Jay" <spam@dummyaddress.sp...

How to list dates in a month of particular weekday
MY question is simple, sorry if i'm being stupid. Can anyone tell me how can i make a list which contains only dates of all the Fridays in a particular month? In a more advanced sense, can I create a list with all the Fridays AND Saturdays of a month? You didn't post a lot of detail about your setup. Assuming the month number is in A1 and your list of Fridays and Saturdays is to be listed in Column B starting at B1, put these formulas in the indicated cells... B1: =DATE(YEAR(NOW()),$A$1,8)-WEEKDAY(DATE(YEAR(NOW()),$A$1,2)) B2: =DATE(YEAR(NOW()),$A$1,8)-WEEKDAY(...

Question about format of reply and format of message
I have two questions about OL2003: 1. Word is set as default editor. In replying message, sometimes I will get extra lines on hitting Enter. It makes more space between paragraphs. Is there any way to insert one line with one Enter? 2. I'd like to have special effect in replying text message sometimes, such as change color of font, but it cannot be done unless changing the message format to be rich text or HTML. If I uncheck Word as default editor, there is an option in menu. What is it about with Word as editor? Thanks, Charles 1 - Check the paragraph spacing settings e...

freezing formatting
I would like to be able to "freeze" the formatting for the number of decimal places in cells - some will need to be integers, some will need three decimal places, etc. The problem comes when I paste in information; the number of decimal places I have formatted the cell for is overridden by the pasted-in data. Any ideas? On Fri, 24 Oct 2003 13:31:05 -0700, "H" <anonymous@discussions.microsoft.com> wrote: >I would like to be able to "freeze" the formatting for the number of decimal places in cells - some will need to be integers, some will need three de...

How do I do a global field search?
I have WinXP and Access2003. I have just finished changing over a text primary key "ProductID" to a autonumber "ProdID". This was successful, and all the database (including the Combos and the xtab queries) work OK. But now I want to get rid of all the old Text "ProductID" values and fields. I have done this manually as far as possible, but is there a "Find" function to locate all the redundant "ProductID" all through the database? Please help Frank No there is such thing built in. You will have to do manual searches through al...

Negative number formatting
Hi everyone, does anyone know how to do this? I hve a column of figures some positive and some negative. I want to format them so taht th negative numbers are expressed in (brackets) and also so that th column itself is decimal aligned, so even if I don't use decimal place the brackets "stick out". I know Word does this in tables, but I can' seem to make Excel do it. Help! Thanks, Vicky. :confused -- VickyJone ----------------------------------------------------------------------- VickyJones's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2448 ...

JavaScript Error adding custom field
Hello, When I try to add a cusom field to the Accounts form I get several JavaScript errors on http:/crm/Tools/FormEditor/Dialogs/addfields.aspx (line 144 : Parameter incorrect) when opening the Web Page Dialog (Field list). When trying to add a field, I get an error 'crmDialog.TabName.returnValue' is null or not an object (line 94 in same aspx) If I continue, I get error 'Object doesn't support this property or method' at line 297. I noticed that this behaviour is only when I contact CRM from one PC. Is there any known compatibility issue as far as the Java VM is concern...

Format Smartlist field
Is it possible to format a smartlist field? Let's say from 2 decimals to 4 decimals? -- SmokyDuck This is only possible in SmartList Builder SmartLists, not in the 'out of the box' SmartLists. In SmartList Builder, you can click on the Display Name of a field, then click the blue arrow in the header to go to Set Field Options. For number fields there will be a tab called Decimal Places. -- Victoria Yudin Dynamics GP MVP Flexible Solutions, Inc. "Smokyduck" <Smokyduck@discussions.microsoft.com> wrote in message news:98223149-4092-484D-886D-F03A319319E...

Enforce format
How can I "enforce" a format in a cell in excel so that it allows number entry only, i.e. it does not allow letters or any other characters. Thanks in advance. Keith Data Validation; custom formula; If active cell is A1, use this: =NOT(ISERROR(1*A1)) "Elfey1001" <Elfey1001@discussions.microsoft.com> wrote in message news:D744EEFC-3BD0-43A7-B673-F16107BBFA03@microsoft.com... > How can I "enforce" a format in a cell in excel so that it allows number > entry only, i.e. it does not allow letters or any other characters. > Thanks in advance. > Kei...

Conditional Formating Help
Hi I wonder if anyone could help me, I am after code for the following. cell e6 = Keys Sent Column f6 = Keys due Column g6 = Keys received What I want the script to do is if there is no value in g6 and todays date is greater then the date stated in F6, then the cell turns red (prompt to inform me that keys are late). Many thanks Dan Use a CF formula of =AND(G6="",TODAY()>F6) HTH Bob "housinglad" <housinglad@discussions.microsoft.com> wrote in message news:A5887369-33DA-489A-BEC9-8173707313C6@microsoft.com... > Hi > ...

Select Case Conditional Formatting Sub?
I've tried to use the Sub below (Posted by Julie D I think) as a work around for more than three conditional formats and it works great IF I enter the data directly in the target cells. But, if the taget range is populated by a formula the color changes do not occur. Is there a way to modify this to work when the cells in the target range are formula driven? (Or, maybe I'm doing something wrong, any ideas?) Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Range("B6:B10")) Is Nothing...

Date calculation in a Query
I have this expression in a form and it works perfect DateAdd("d",63-Weekday(FirstContact,7),FirstContact) But, where should I write it in a query? The query should show all the items that shoul be removed from the list on the calculated date, and update the "removed from the list" the field from there. Thanks Ioia Add the expression as a calculated field in the query Field: Removal: DateAdd("d",63-Weekday(FirstContact,7),FirstContact) Criteria: = #2009-11-27# Then you can apply criteria against the calculated field. Another option would be...

Outlook 2003 unresponsive when viewing messages in HTML format.
About two weeks ago, I started Outlook and went in to view messages. On some messages, Outlook would appear to lock up and my harddrive light would come on continuously for a minute or more. The body of the message would appear as an empty window. We have discovered that the problem only occurs for email messages that are in HTML format. I can prevent the problem by going to: Tools > Options > Email Options and checking "Read all standard mail in plain text". When I have this option turned on, I can see a plain text version of the message. Unfortunately, much of ...

Add opt. to change Printer-Friendly format to user defined format
This is a customer suggestion from Convergence. Customer would like to be able to have the option to change the Printer-Friendly format to a different/user defined format. 1. Employee enters a requisition. 2. Purchasing manager processes the Requisition: BP>Purchasing>Requisitions 3. Select a vendor and requisition. 3. User selects to view the requisition; Printer-Friendly Version opens. ISSUE: Currently, there are no options to define report format. For further inquiry- Customer Information: Jon Heseman, PC Administrator EFCO Systems 1800 N.E. Broadway Des Moines, Iowa...

Searching through DB Table containing Records in XML format
Guru's! Your time and guidance is much appreciated in this task that i am trying to get done. Background I have a SQL Server 2000 database table which contains 2 Fields (RecordID, XMLData (datatype=TEXT). There are about 10,000 records in this table. The Data in the field (XMLData) is a XML formatted string. (where F1,F2... are elements and v1, v2 is the data) <ControlRecord><F1>V1</F1><F2>V2</F2><F3>V3</F3><F4>V4</F4><F5>v5</F5><f6>v6 </f6>.....Upto 14 fields </ControlRecord> <ControlRecord><...

When copying from "date" cell to "general" cell, how to keep date.
An Excel question for you: when I try to copy data from a "date" formatted cell over to a concatenate formula in a "general" formatted field, it transfers the data over as the boolean value. This is causing endless headaches because I am trying to upload the information into our financial software. Do you know a solution for this? I think you mean the date comes over as the serial value. If not, this may not be right. In the concatenate function, embed the Text function. ex: A1 has 5/16/2004, B1 has "TEST" in it. C1 formula would be =concatenate (TEX...

Excluding Alpha character in text field by filtering.
I have a query based on a table./ I have one numeric field that has alphanumber entries: A2000-000; 101010010,A2004, etc.. I what the filter to exclude all records that have an apph beginning - ie. in eg. above exclude: A2000-000,A2004. How do I do this? Your assistance is greatly appreciated. You could use WHERE Left$(AlphanumericField, 1) NOT BETWEEN "A" AND "Z" or WHERE Val(AlphanumeriField) <> 0 -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Grace" <fhsmith7@bellsouth.net> wrote in message news...

How to format the value in a cell?
Hello! I wonder if excel has the function to format a value in cell without the help of Macro. To format a value,here I mean to correct the value automatically. For example,it need the value in a cell to be "T".But a user may enter " T","T ","t".The formatting function used here to trim the space at the begining or end of "T",or change the "t" to upper case. -------------------- An Try =TRIM(UPPER(A1)) -- Regards Roger Govier "An" <abc@sohu.com> wrote in message news:u%23Kg%23X6hFHA.576@tk2msftngp13.phx.gb...

extracting data from one format to a different format...
I have a large database of company contacts that is formatted/entered as follows: ABC Company, Inc. John Doe 123 Main Street NE Des Moines, IA 52000 Phone: 123-456-7890 Fax: 098-765-4321 jdoe@abccompany.com Each line is in it's own cell, but I need it in column format such as follows: Company Name - First Name - Last Name - Address1 - Address2 - City - State - Zip - Phone - Fax - Email Any direction as to how I can easily do this? I'm using either 2003 or 2007 and have over 7,000 entries like this. PLEASE HELP as I don't want to spend hours into days try...

Remove formatting from SSN
I exported some data from an Access database. The Social Security Numbers are in this format: 123-45-6789. I would like to change them all to 123456789. I've tried creating a Custom Format and formatting the cells, but nothing changed. Tried setting the format of a new column, then cutting and pasting or Paste Special into the new cells, but it keeps the old formatting. Is there an answer? Try this in a "helper" column: =TEXT(A1,"000000000") To retain your leading zeroes. -- HTH, RD ============================================== Please keep all corres...