[AccessD] Time Conversion

MartyConnelly martyconnelly at shaw.ca
Tue Aug 1 11:29:10 CDT 2006


Try the VarType function if you are unsure of what is being returned
in a variable especiallty a variant. Just in case missing from your help
file.

VarType Function
Returns an Integer indicating the subtype of a variable.

Syntax    VarType(varname)

The required varname argument is a Variant containing any variable 
except a variable of a user-defined type.

Return Values

Constant    Value    Description

vbEmpty    0    Empty (uninitialized)
vbNull    1    Null (no valid data)
vbInteger    2    Integer
vbLong    3    Long integer
vbSingle    4    Single-precision floating-point number
vbDouble    5    Double-precision floating-point number
vbCurrency    6    Currency value
vbDate    7    Date value
vbString    8    String
vbObject    9    Object
vbError    10    Error value
vbBoolean    11    Boolean value
vbVariant    12    Variant (used only with arrays of variants)
vbDataObject    13    A data access object
vbDecimal    14    Decimal value
vbByte    17    Byte value
vbArray    8192    Array

Note   These constants are specified by Visual Basic for Applications. 
The names can be used anywhere in your code in place of the actual values.
Remarks

The VarType function never returns the value for vbArray by itself. It 
is always added to some other value to indicate an array of a particular 
type. The constant vbVariant is only returned in conjunction with 
vbArray to indicate that the argument to the VarType function is an 
array of type Variant. For example, the value returned for an array of 
integers is calculated as vbInteger + vbArray, or 8194. If an object has 
a default property, VarType (object) returns the type of the object's 
default property.



paul.hartland at fsmail.net wrote:

>Thanks for all replies sorted now, I had already tried the CDBl function ans was getting errors, found out it was cause the hours were returning in a string and not a date format.....What I would do without this list I do not know.
>
>Paul Hartland
>
>
>
>
>
>Message Received: Aug 01 2006, 12:03 PM
>From: "MastercafeCTV" 
>To: "'Access Developers discussion and problem solving'" 
>Cc: 
>Subject: Re: [AccessD] Time Conversion
>
>On access one day = 1
>1 Day= 24h 
>If you want this values in format Hour then only need multiply by 24
>
>csng(#15:30:00#)*24 = 15.50
>
>Hope this simple function can help you :-)
>
>Juan Menendez
>www.mastercafe.com
>info at mastercafe.com
>
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
>paul.hartland at fsmail.net
>Sent: martes, 01 de agosto de 2006 12:27
>To: accessd
>Subject: [AccessD] Time Conversion
>Importance: High
>
>
>To all,
>
>Sorry for the post I am sure I have seen this before but must be going mad
>as can't seem to find the examples, basically what I want to do is convert
>the hours I get in my table 4:15, 4:30, 4:45 to 4.25, 4.50, 4.75 etc....Can
>anyone point me to this function please.
>
>Thanks in advance for any help on this.
>
>Paul Hartland
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada




More information about the AccessD mailing list