• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

help me, this is driving me insane!

Martin

Lifer
I have a access db, ODBC DSN link to it and I am using PHP.

all I want to do is insert a date into a DateTime field, but nothing I've tried helps. Anybody ahve any clue? I can get the date into any format I need (date, timestamp etc), but it won't let me insert either way.
 
Originally posted by: Martin
I have a access db, ODBC DSN link to it and I am using PHP.

all I want to do is insert a date into a DateTime field, but nothing I've tried helps. Anybody ahve any clue? I can get the date into any format I need (date, timestamp etc), but it won't let me insert either way.

are permissions set correctly? Can you read from the table? Can you write to other things besides date time?
 
Originally posted by: EmperorIQ
Originally posted by: Martin
I have a access db, ODBC DSN link to it and I am using PHP.

all I want to do is insert a date into a DateTime field, but nothing I've tried helps. Anybody ahve any clue? I can get the date into any format I need (date, timestamp etc), but it won't let me insert either way.

are permissions set correctly? Can you read from the table? Can you write to other things besides date time?

yeah, I can insert othr values fine (in this case doubles). I really hate access :

<-- likes his SQL server at work.
 
INSERT INTO data (timestamp, bid, ask) VALUES ('2005/06/01 4:32:01 AM', 1.2317, 1.2319)

timestamp being datetime, other two beign number (double)

if I take off timestamp, it can insert the others fine enough.
 
From an Experts Exchange post: (god I hate that site...damn subscriptions!)

I believe format for inserting into a DATETIME field is:

4/1/2001 3:00:00

or, others have used this format:

1962-05-20 10:32:16

Someone was asking the same question you are. Put it in single quotes. It worked for this guy.
 
i tried a bunch of different formats, with and without AM/PM, but none worked.

I've been googlingk but I can't find a single example of insert into ODBC using a date.
 
I can't recall exactly what the situation was - but I know that there was an incompatibility between PHP, ODBC, and Access in relationship to timestamping. I haven't had to research the problem in years... but for some reason it occurs to me that I used some alternate method in the end.
 
i am an oracle guy but do you need to convert the date/time string into a timestamp format first using a function?

 
Originally posted by: bunker
From an Experts Exchange post: (god I hate that site...damn subscriptions!)

I believe format for inserting into a DATETIME field is:

4/1/2001 3:00:00

or, others have used this format:

1962-05-20 10:32:16

Someone was asking the same question you are. Put it in single quotes. It worked for this guy.


neither of those works. ether in PHP or access itself. i hate access.
 
well, I got it. I outputed to a CSV file using the 1962-05-20 10:32:16 format. then imported into Access.

but I lost 40 minutes of my life to that stupid piece of ****** program :\
 
timestamp might be a reserved word in msaccess, try [timestamp] instead
i HATE msaccess, the small errors like this never give you any information about what went wrong

INSERT INTO data ([timestamp], bid, ask) VALUES ('2005/06/01 4:32:01 AM', 1.2317, 1.2319)
 
Back
Top