Jump to content
Sign in to follow this  
slbr549

ODBC Excel Connection- read FM record based on Matching Cell

Recommended Posts

I am using Excel 365 on desktop and FileMaker Pro Advanced 15 with FileMaker Server. 

I am able to connect to FileMaker from Excel using ODBC to read all records in a table or matching it to a hard coded name. Sample:

Select work FROM "Student Time Import" WHERE badgename="Patrick Dollar"

What I'd like to do is add a where clause where it selects hours worked based on the date in the Excel spreadsheet. The cell's date is B12 and so on.  I know my syntax is wrong, but after several attempts, I haven't been able to solve it. Here is my syntax:

Select work FROM "Student Time Import" WHERE badgename="Patrick Dollar" and date = TimeSHeet(Select * FROM[SHRA Temp Timesheet.Range("B12).Value])

Thanks.

 

Share this post


Link to post
Share on other sites

This is more an excel question than a FM question so you may be better off asking this on an excel forum; every environment has its own specific way of constructing the SQL query.

One quick  note though: you have a field named "date".  That's a reserved SQL keyword and also the name for a datatype in most environments so try to avoid that name.  At the very least you will have to quote the name in your sql query.

  • Like 1

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Similar Content

    • By trevix
      On windows 7 (VMware on OSX), using FMP17 and Microsoft Access 2016
      Trying to do a ODBC import and selecting the datasource, I get asked for Username and password, even if the Access DB is not password protected.
      The data sources are correct (tested from Livecode) and should be working without user name and password.
      On the properties of the ODBC pane setup the path seems correct (not pointing to 32): %windir%\SysWOW64\odbcad32.exe
      What am I missing?
    • By brownt
      I have a friend for whom I've done a bit of consulting helping him build some project tracking tools in FileMaker.  Helped him through the basic stuff around relating tables together, doing a bit of scripting, creating some basic reports based on data he's entered... Well, now he's hooked!  And would like to do everything for his business in FileMaker.  His current partner does everything in Excel, and has over the years developed a project management spreadsheet he uses to track project funds, activities and generate a financial summary for their clients...  Well, now I've been asked to see if it can be redeveloped in FileMaker, because my friend doesn't want multitudes of Excel sheets for every project, that he has to paw through when he wants to pull data for his other tracking tools that are in FileMaker.   He'd like to be keeping all the data in one place.
      His partner's Excel sheet basically tracks the date of an activity, a note about the activity (what business or consultant or company performed the activity), what kind of activity it is (each spreadsheet for each project may have anywhere from 8 to 16 different kinds of activity) and how much money was associated with that activity (credit or expense).  Tracking that is not a tough deal in FileMaker, that piece I've already sketched out.  Reporting on it is where I'm having problems, because he'd like FileMaker to produce a report that looks as close to what the Excel sheet looks like, including columns for each kind of activity they're tracking, with activity totals, balances, budget remaining, etc...  Where I'm really really running aground is the fact that there may be any number of different kinds of activity going from project to project.  Some may have 7 different kinds of activity, some may have 15 or 20. 
      I've included a sanitized, example version of one of his Excel files.  I can't wrap my head around how best to do up a report that doesn't have a set number of fields (what would correspond to the columns in his Excel).  I could do it as a great big flat file database and put in fields for every possible kind of project activity, I guess, but.... argh!  
      I would welcome any thoughts on how a report like the one I've included as an Excel file here could be created in FileMaker...  Or if the combined expertise here figures this is something that is best left to Excel (I must admit, my thoughts have drifted that direction as I wrestle with this).
       
      Thanks in advance!
      report.xlsx
    • By jchallenw
      Does anyone have experience and/or success using a 4D database as an external datasource through ODBC. I can add the system DSN and add it to FMP. Once I attempt to view the tables in the 4D database, I receive an error that the "ODBC connection is not compatible". Does anyone have a work around or suggestions? Thanks!
    • By Franziska B
      Dear 360 Works Team

      In our FileMaker Solution we want to create an Excel report including text, numbers (dates) and images via Scribe.

      The FileMaker export of text and numbers works fine. But we have a problem with the export of images in the xlsx.

      After the Creation of the Excel reports all text- and number elements are in the .xlsx but the image not.


       
      When we open the generated .xlsx, Excel shows the attached error massage:


      For the export of the pictures, we test following script commands:  
       
      ScribeDocValue[Name:“F5“;Value: table:: cell]
       
      ScribeDocWriteValue("Table1!F5", table::cell)
      SetVariable[$PicXYZ; Value: ScribeDocWriteValue("Table1!F5", table::cell)]
       
      Do we make a mistake, or could this be a known bug?
       
      Our Systemconfig:
      FileMaker Pro Advanced 16.0.4.403
      Excel 2010 and Office 365;          
      360 Works Scribe 3.08 and Scribe 3.09
      Server:
      FM Server 16.0.3.304
      Microsoft Windows Server 2008 R2 Standard
      Version 6.1.7601 Service Pack 1 Build 7601
      Could you help me please?
      Thanks


    • By Christopher Gauntt
      Hello all,
      I installed FileMaker Pro ODBC drivers, and was able to access the data with queries from Microsoft Excel.
      However, when I tried to access the same data with the same driver using Microsoft Visual Studio 2015, it could see the table occurrences, but it couldn't find any of the data columns.  It came back with the following error:
      " Error at Data Flow Task [ODBC Source [1]]: There was an error while trying to get schema information. Table has no columns."
      I got the same error, no matter which table occurrence I selected.
      Has anyone else run into this and solved it?
      I have been google searching without much luck.  Although I found one post of someone who claimed they were able to do it with Microsoft Visual Studio 2017, so maybe an upgrade is in order?
      Thanks in advance,
      Chris
       
       
       
×

Important Information

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