Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8641 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

FMP Import Experts,

I am using ODBC and SQL to UPDATE a FMP file and I can't seem to find out how to format a time field type to make FMP's ODBC driver happy.

I tried single quotes '12:00:00' and it didn't like that. I then tried the curly brackets (where did that little beauty come from? I have never heard of that in SQL before!) that made the time look like {12:00:00}, but this just caused an error that the data didn't appear to be a date (duh, that's because it is a time). The errors I get are below.

Is it possible to update a time value using SQL and ODBC? If so, how to I let the ODBC engine know that I am sending a time value? Am I supposed to convert it to an integer (like the number of seconds since 1-1-1970) or something?

Here is the KB article for reference:

http://tidb.filemaker.com/ti/FMPro?-db=ti.fp5&-lay=list&-sortfield=relevancecalc&-sortorder=descend&product=filemaker&article=import%20time&-token.0=filemakerimport%20time&-token.1 =168&-find=&-format=detail.html&-recid=12590445

You'll need to get that all on one line to get it to work in your browser. It distinctly says that for an INSERT you surround both the date and time types with curly brackets. Mysteriously, is leaves out the time type in the same statement about the UPDATE syntax...hmmm...

Below are the errors I am getting for reference. First the one where I use quotes:

UPDATE Test SET name_first = 'Mike',time_begin = '12:00:00' W

HERE number = '1'

DBD::ODBC::db prepare failed: [FileMaker][ODBC FileMaker Pro driver]An UPDATE ex

pression didn't match the data type of its corresponding column (SQL-37000)

Then when I use curly brackets:

UPDATE Test SET name_first = 'Mike',time_begin = {12:00:00} W

HERE number = '1'

DBD::ODBC::db prepare failed: [FileMaker][ODBC FileMaker Pro driver]Invalid date

value: 12?? (SQL-37000)

Michael

Posted

Hi,

I didn't see the ODBC forum. Maybe this needs to go there?

I won't cross post (not sure if that would be appreciated) but maybe the moderator can move it over there if he thinks it is necessary?

Michael

Posted

Maybe no one is using ODBC? laugh.gif

Anyhow I guess for now I can import the time fields as text into separate fields and then have the FM script developer copy and paste into the time fields. Is that possible?

I'd sure like to know if there is a way to get them in there directly using ODBC instead of having to use the band-aid approach.

Michael

  • 3 weeks later...
Posted

Hi,

Did you ever solve this problem? I don't usually look in this forum since I've never used ODBC. However, I suspect that Filemaker is actually expecting an integer value for times and dates, since FM stores times internally as seconds past midnight, and dates as number of days since January 1, 1904. If you can format them this way, I suspect it may solve your problem.

This topic is 8641 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.