Sign in to follow this  
Followers 0
Jamal Mazrui

Variant date type

2 posts in this topic

I am developing a program that uses the ADO com-based API for reading and writing to a Microsoft Access database. I can access numeric and text fields in a table, but have been unable to access a Date or DateTime field. For example, if Birthday is the name of a date field and $RS is a record set object, then the expression

$Birthday = $RS.Fields("Birthday").Value

should return a variant of the date subtype.

If I display the result of this expression in AutoIt, I get a number, but I have not been able to figure out how to translate this number into a date in a readable format. The number is not a Julian date number, for example.

I looked for API functions that could convert a variant date for me, but was unable to find one that I could call via AutoIt. In particular, VariantTimeToSystemTime requires a Double as the first parameter, and there does not seem to be a way to pass this data type in an API call.

I would appreciate any suggestions, as this affects the success of a project at work.

Share this post


Link to post
Share on other sites



I am developing a program that uses the ADO com-based API for reading and writing to a Microsoft Access database. I can access numeric and text fields in a table, but have been unable to access a Date or DateTime field. For example, if Birthday is the name of a date field and $RS is a record set object, then the expression

$Birthday = $RS.Fields("Birthday").Value

should return a variant of the date subtype.

If I display the result of this expression in AutoIt, I get a number, but I have not been able to figure out how to translate this number into a date in a readable format. The number is not a Julian date number, for example.

I looked for API functions that could convert a variant date for me, but was unable to find one that I could call via AutoIt. In particular, VariantTimeToSystemTime requires a Double as the first parameter, and there does not seem to be a way to pass this data type in an API call.

I would appreciate any suggestions, as this affects the success of a project at work.

Is the value the same as what Excel is using ?

Can you give an example of the value and the original date/time for it ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0