Problems with dates in Access programming in C++

  • Thread starter Thread starter Toni
  • Start date Start date
T

Toni

Hi all,

I am trying to do a Select from C++ to a DB in Access, my problem is with
the date, I have a string variable with contain a date in this format:
dd/mm/yyyy, when I execute the select, access doesnt find any row with this
date because access store the dates in format mm/dd/yyyy, since my varible
is a string I cant use the format command in the select. How can I solve my
problem?

Thank you very much
Toni
 
You could use the string manipulation functions to break the string apart
and put it back in the desired order. In VB, those functions would be
InStr(), Left(), Right(), Mid() and concatenantion.
 
PS,

Does VC++ have an equivalent to VB's CDate() function (convert to date)? If
so, you may be able to convert the string to a date then format it.

Format(CDate(strVariable), "mm/dd/yyyy")
 
Back
Top