Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

odbc sql update time type

Featured Replies

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

  • Author

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

  • Author

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

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.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.