How to retrieve non-formatted values using getField(): 
Author Message
 How to retrieve non-formatted values using getField():

Hi,

I am trying to get the properties of a Task using the getField method. I
choose not to get the property from the Task directly (eg.
Task.PercentComplete) because I don't know which field I want to
retrieve until runtime.
The problem I'm facing is that, unlike the second method (getting the
property directly), the getField method returns a formatted value i.e.
Task.getField(PjField.pjTaskPercentComplete) returns "12.5%" rather than
just "12.5"

It is the same case for dates. getField returns the dates formatted
according to the mask the user has chosen. Is there a way to use
getField to return the "native" task property (like Task.PercentComplete
or Task.Start)?

Your help is appreciated.

--Zahid.

  zahid.khan.vcf
< 1K Download


Tue, 30 Nov 2004 09:27:48 GMT  
 How to retrieve non-formatted values using getField():
Hi,

Val("12.5%") returns the number 12.5

save the date information into a date variable and you can reformat the date
into anything you want using Format$(date,"Long Date")

See help on conversion functions and Format for other methods.

--

Visit www.mvps.org/project/ for the Project MVP's FAQ and third party
add-ons

Rod Gill
Microsoft Project MVP
Visit www.projectlearning.com for customized Project and Office VBA macros
and Project companion software


Quote:
> Hi,

> I am trying to get the properties of a Task using the getField method. I
> choose not to get the property from the Task directly (eg.
> Task.PercentComplete) because I don't know which field I want to
> retrieve until runtime.
> The problem I'm facing is that, unlike the second method (getting the
> property directly), the getField method returns a formatted value i.e.
> Task.getField(PjField.pjTaskPercentComplete) returns "12.5%" rather than
> just "12.5"

> It is the same case for dates. getField returns the dates formatted
> according to the mask the user has chosen. Is there a way to use
> getField to return the "native" task property (like Task.PercentComplete
> or Task.Start)?

> Your help is appreciated.

> --Zahid.



Wed, 01 Dec 2004 09:44:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Task.GetField OK, but Assignment.GetField ??

2. Retrieving the value of a var whose name is available in string format

3. Using non-American date formats

4. retrieving time using Format()

5. Q] Retrieving a single value without using Recordset

6. Retrieving cell value in MSHFlexgrid using ADO

7. .GetField(pjTaskNotes) Returns Continuation Characters

8. Fast SQL searches to retrieve non-key fields

9. Component to retrieve non-default interfaces

10. Non-US date formats and SQL

11. Reading Non-sequential File Formats

12. Non-US date formats - coping with

 

 
Powered by phpBB® Forum Software