1

I've got a external data source setup in Microsoft Excel which queries an external FoxPro database via Microsoft Query.

One of the lines in the query is WHERE (ihead.ih_date>={d '2018-10-01'}) but I want to change this date to be a parameter driven by a cell in Excel.

I've tried all different combinations of where to put the ? and what to put in the cell, but they all return "Operator/operand type mismatch".

Where should I position the ? and what should be in the cell?

Thanks.

Richard
  • 316
  • 4
  • 13
  • 2
    Probably because the cell value is being taken as text, try changing ihead.ih_date to dtoc(ihead.ih_date) – Alan B Nov 15 '18 at 09:44

1 Answers1

2

Thanks to Alan I've got it working.

I looked up what DTOC does, and found I needed to add ,1 to make it indexable.

I also needed to change the excel cell to be formatted as YYYYMMDD.

Now it's (dtoc(ihead.ih_date,1)>=?) and it works fine.

Richard
  • 316
  • 4
  • 13