Problems with dates in Access programming in C++

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
 
W

Wayne Morgan

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.
 
W

Wayne Morgan

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top