Senin, 08 Desember 2025

Sabtu, 06 Desember 2025

Re: [MSAccessProfessionals] Conditional Number formating

The solution I have seen at a former employer was to have a second field to store the precision (# of decimal places). 

Duane
Sent from my mobile

On Dec 5, 2025, at 9:18 AM, Jane via groups.io <jcross=crossproducts.plus.com@groups.io> wrote:


Hi
I have a numeric field (double), which I need to save/ display exactly according to how the user entered it.  I don't want to change it to a text field as the system does use it for calculations. Also general formatting to 2dp for example will show all numbers the same. 
eg 

User Enters

Currently Displays

Required Display

10.50

10.5

10.50

11

11

11

10.0

10

10.0

 
Any suggestions?
Many thanks
Jane

Jumat, 05 Desember 2025

Re: [MSAccessProfessionals] Conditional Number formating

Hi Jane,

 

In some cases, it is OK to store a number as text, and then use it in numerical calculations. VBA or the Access Expression Service (if using a query) will do the type coercion for you.

Example:

Dim d As Double

Dim s As String

s = "10.50"

d = s + 1

Debug.Print d

 

This will print the number 11.5

 

You can also write the calculation as:
d = CDbl(s) + 1

This makes the type coercion explicit. That would be my preference.

 

If for some reason this is not good enough for you, then consider adding a text field to the table for the user-entered string, and turn the current numeric field into a Calculated field with the expression:
CDbl([yourTextField])

 

Best Regards,

 

-Tom van Stiphout.

Microsoft Access MVP

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Jane via groups.io
Sent: Friday, December 5, 2025 8:19 AM
To: MSAccessProfessionals@groups.io
Subject: [MSAccessProfessionals] Conditional Number formating

 

Hi

I have a numeric field (double), which I need to save/ display exactly according to how the user entered it.  I don't want to change it to a text field as the system does use it for calculations. Also general formatting to 2dp for example will show all numbers the same. 

eg 

User Enters

Currently Displays

Required Display

10.50

10.5

10.50

11

11

11

10.0

10

10.0

 

Any suggestions?

Many thanks

Jane

[MSAccessProfessionals] Conditional Number formating

Hi
I have a numeric field (double), which I need to save/ display exactly according to how the user entered it.  I don't want to change it to a text field as the system does use it for calculations. Also general formatting to 2dp for example will show all numbers the same. 
eg 

User Enters

Currently Displays

Required Display

10.50

10.5

10.50

11

11

11

10.0

10

10.0

 
Any suggestions?
Many thanks
Jane
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116717) | Reply to Group | Reply to Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Senin, 01 Desember 2025

Re: [MSAccessProfessionals] Different data in same column

Good morning Duane,

 

Yes, I was able to use a crosstab query as suggested.  Thanks for reaching out. 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Duane Hookom via groups.io
Sent: Monday, December 1, 2025 6:40 AM
To: MSAccessProfessionals@groups.io
Subject: Re: [MSAccessProfessionals] Different data in same column

 

Doyce, Is there any follow-up to your question? Did you get the assistance you needed? Duane From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Duane Hookom via groups.io <duanehookom=hotmail.com@groups.io>

ZjQcmQRYFpfptBannerStart

This Message Is From an Untrusted Sender

You have not previously corresponded with this sender.

ZjQcmQRYFpfptBannerEnd

Doyce,

Is there any follow-up to your question? Did you get the assistance you needed?

 

Duane


From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Duane Hookom via groups.io <duanehookom=hotmail.com@groups.io>
Sent: Monday, November 17, 2025 4:02 PM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] Different data in same column

 

The "new" format is the most useful since it's normalized. You can create a crosstab query with the pay code as the column heading. The employee ID and I expect a date filed will be the Row Headings and Sum of hours as the value. 

 

Duane

 



On Nov 17, 2025, at 2:19PM, Doyce Winberry via groups.io <doyce.winberry=xpo.com@groups.io> wrote:



Friends,

 

We have a new timekeeping system and I'm used to importing hours from the old system into a database where it can be sliced, diced, grouped, and etc.  Unfortunately, now when I'm running a report to extract the hours, there are so many types of paycodes used that the report puts all the paycodes in same column and the hours associated with each paycode in another "shared" column instead of making a column for each paycode and putting the hours in the correct column.  See examples:

This is the report I get.

Employee ID

Paycode

Total Hours

30252579

PTO Scheduled Current Year

3.50

30252579

Regular

36.57

30244320

Overtime

0.20

30244320

Regular

40.00

30250342

Regular

40.00

30250342

Overtime

0.18

30079782

Overtime

0.38

30079782

Regular

40.00

30268802

Regular

40.00

30268802

Overtime

0.33

 

This is how I want the data with 1 line per employee ID:

Employee ID

Regular

OverTime

PTO

30252579

36.56667

3.5

30244320

40

0.2

30250342

40

0.183333333

30079782

40

0.383333333

30268802

40

0.333333333

 

Are there any easy ways to do this?  My thoughts are to query the top table with If statements to then use a totals query on the first query to put all the records into one row.    

 

 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

Re: [MSAccessProfessionals] Different data in same column

Doyce,
Is there any follow-up to your question? Did you get the assistance you needed?

Duane

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Duane Hookom via groups.io <duanehookom=hotmail.com@groups.io>
Sent: Monday, November 17, 2025 4:02 PM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] Different data in same column
 
The "new" format is the most useful since it's normalized. You can create a crosstab query with the pay code as the column heading. The employee ID and I expect a date filed will be the Row Headings and Sum of hours as the value. 

Duane


On Nov 17, 2025, at 2:19 PM, Doyce Winberry via groups.io <doyce.winberry=xpo.com@groups.io> wrote:



Friends,

 

We have a new timekeeping system and I'm used to importing hours from the old system into a database where it can be sliced, diced, grouped, and etc.  Unfortunately, now when I'm running a report to extract the hours, there are so many types of paycodes used that the report puts all the paycodes in same column and the hours associated with each paycode in another "shared" column instead of making a column for each paycode and putting the hours in the correct column.  See examples:

This is the report I get.

Employee ID

Paycode

Total Hours

30252579

PTO Scheduled Current Year

3.50

30252579

Regular

36.57

30244320

Overtime

0.20

30244320

Regular

40.00

30250342

Regular

40.00

30250342

Overtime

0.18

30079782

Overtime

0.38

30079782

Regular

40.00

30268802

Regular

40.00

30268802

Overtime

0.33

 

This is how I want the data with 1 line per employee ID:

Employee ID

Regular

OverTime

PTO

30252579

36.56667

3.5

30244320

40

0.2

30250342

40

0.183333333

30079782

40

0.383333333

30268802

40

0.333333333

 

Are there any easy ways to do this?  My thoughts are to query the top table with If statements to then use a totals query on the first query to put all the records into one row.    

 

 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269