Jump to content

Variant date type


Recommended Posts

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.

Link to comment
Share on other sites

  • Developers

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 ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...