473,503 Members | 544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formatting more than one field at the same time (and dates as dates)

If I need to format how the content of a field is displayed, I can
click ALT + ENTER from design view, and specify the format, for
example, the number of decimal digits and so on.
Is there a way to apply the same kind of formatting to more than one
field at the same time? I tried selecting multiple fields, but if then
I click ALT + ENTER I don't have the option to choose formatting.

Also, how can I format dates as dates? I have a table with some dates,
that are properly recognized and formatted. I create a summary query
showing the average dates by certain fields. However, the average
appears as a number and I can find no way to format it as a date. The
only solution I could find was to export the table to Excel and format
it as a date there, but it clearly is not an effective solution...

Thank you in advance for your help!

Oct 9 '07 #1
3 2094
A1: There is no problem with selecting several controls at once, and then
setting their Format property in the Properties box.

A2: See:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
The article explains how to use CVDate() around the calculated field so JET
recognises it as a date. If you don't follow how to apply this, post your
SQL statement.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<my********@googlemail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
If I need to format how the content of a field is displayed, I can
click ALT + ENTER from design view, and specify the format, for
example, the number of decimal digits and so on.
Is there a way to apply the same kind of formatting to more than one
field at the same time? I tried selecting multiple fields, but if then
I click ALT + ENTER I don't have the option to choose formatting.

Also, how can I format dates as dates? I have a table with some dates,
that are properly recognized and formatted. I create a summary query
showing the average dates by certain fields. However, the average
appears as a number and I can find no way to format it as a date. The
only solution I could find was to export the table to Excel and format
it as a date there, but it clearly is not an effective solution...

Thank you in advance for your help!
Oct 9 '07 #2
On 9 Oct, 15:21, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
A1: There is no problem with selecting several controls at once, and then
setting their Format property in the Properties box.
I'm sorry, but I'm a novice to Access and don't quite follow you.
I'd like to format the way Access shows certain fields in tables and
queries (e.g. set the number of decimal digits displayed). To do this,
I open the table/query I want in design view, select a column, click
ALT+ENTER, and choose the format I want from "format" in the property
sheet which appears. However, if I select more than one column and
then click ALT+ENTER, the property sheet which appears is different
and no longer has the "format" option.
I'm sorry if this may seem banal but I really have no clue! Btw, is
that the only way to format a field?
A2: See:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
The article explains how to use CVDate() around the calculated field so JET
recognises it as a date. If you don't follow how to apply this, post your
SQL statement.
It doesn't work :(
The date fields are correctly formatted, recognized and displayed as
dates. However, I need to create another table which summarizes the
average date by type of account; The SQL code is:

SELECT DISTINCTROW [Main - with L8M CashFlows].SegmentDescription,
Avg([Main - with L8M CashFlows].Default_Date) AS AvgOfDefault_Date
FROM [Main - with L8M CashFlows]
GROUP BY [Main - with L8M CashFlows].SegmentDescription;

The calculations are correct, but I can't format the averages as
dates. I tried with CDate:

SELECT DISTINCTROW [Main - with L8M CashFlows].SegmentDescription,
Avg(CDate([Default_Date])) AS ReformattedDate
FROM [Main - with L8M CashFlows]
GROUP BY [Main - with L8M CashFlows].SegmentDescription;

Thanks!
Oct 9 '07 #3
Ah: you're trying to do that in table design, not form design?

Don't bother. Leave the Format property in the table blank. Instead, create
a form where the data is entered. (You can use Datasheet view if you want it
to look like a table.) In form design view, you can select several controls
at once, and apply a format.

Think of the table as the bucket to hold the data, and the form as the
interface to find/enter/manage the data. Therefore you don't need to format
the data in the table itself. (And there is a bug in Access 2003 SP3 that
doesn't display some data correctly if the table field has a Format
applied.)

BTW, if you have lots of repeating fields (such as Jan, Feb, Mar, ...), you
have a spreasheet type design, not something that is suitable for a
database. You will need to break the table into 2: one for whatever the main
record is, and a related table where you have a *record* for each month's
value.

Did you use Date/Time fields in table design? Or Text fields? If they are
date fields, you will be able to fix the problem as suggested. If you're
still stuck, switch your query to SQL View (View menu in query design), copy
the SQL statement, and post it here.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<my********@googlemail.comwrote in message
news:11**********************@50g2000hsm.googlegro ups.com...
On 9 Oct, 15:21, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
>A1: There is no problem with selecting several controls at once, and then
setting their Format property in the Properties box.

I'm sorry, but I'm a novice to Access and don't quite follow you.
I'd like to format the way Access shows certain fields in tables and
queries (e.g. set the number of decimal digits displayed). To do this,
I open the table/query I want in design view, select a column, click
ALT+ENTER, and choose the format I want from "format" in the property
sheet which appears. However, if I select more than one column and
then click ALT+ENTER, the property sheet which appears is different
and no longer has the "format" option.
I'm sorry if this may seem banal but I really have no clue! Btw, is
that the only way to format a field?
>A2: See:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
The article explains how to use CVDate() around the calculated field so
JET
recognises it as a date. If you don't follow how to apply this, post your
SQL statement.

It doesn't work :(
The date fields are correctly formatted, recognized and displayed as
dates. However, I need to create another table which summarizes the
average date by type of account; The SQL code is:

SELECT DISTINCTROW [Main - with L8M CashFlows].SegmentDescription,
Avg([Main - with L8M CashFlows].Default_Date) AS AvgOfDefault_Date
FROM [Main - with L8M CashFlows]
GROUP BY [Main - with L8M CashFlows].SegmentDescription;

The calculations are correct, but I can't format the averages as
dates. I tried with CDate:

SELECT DISTINCTROW [Main - with L8M CashFlows].SegmentDescription,
Avg(CDate([Default_Date])) AS ReformattedDate
FROM [Main - with L8M CashFlows]
GROUP BY [Main - with L8M CashFlows].SegmentDescription;

Thanks!
Oct 9 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
9425
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
3
1566
by: joe ruggeri | last post by:
Hey All ... I'm developing in ASP/VBScript using DreamweaberMX, w/ an Access 2000 DB as the data source. The source of the data is coming from a third party, which I get as a CSV and import into...
8
3486
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
2
1190
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold...
2
1516
by: Thomas Beyerlein | last post by:
I am binding dates to a textbox, the date is stored in SQL in a datetime field. When it gets bound it turns it into a long date (Sunday, Dec. 25 2005), in SQL when viewing the table it views as a...
2
2395
by: sgtted71 | last post by:
I have searched the Word Help and the Access Help, I have consulted the well used Access Bible that sits behind my desk, and to no avail...so now I consult the mighty brain trust that is...
11
6346
by: tlyczko | last post by:
Hello, I'm new to SQL Server, working for a non-profit computerizing a lot of its data. I imported a table of people's names, birth dates, etc. into SS2005 from Access, and the birth_date was...
4
3319
by: Jeff Goodman | last post by:
If there is a better newsgroup to post this in, please let me know. I am a relatively new VB.NET/SQL 2000 programmer. I am working with data imported into SQL2K from Access. Many of the dates...
1
2541
by: Greg (codepug | last post by:
Access 2000 Using a textbox of a single form, I created a calculated field. The following code is in the Control Source for this field: =IIf(=24,+(/),/ ) The numbers that are calculated are...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.