I made a Little test with yur script and with a small inline table
Load * Inline [
The result is also 0 datarows.
but when i Change Tagesdatum2 to Tagesdatum (which still is in the old data Format), I get 1 datarow
I donot know why comparison of 2 different dateformats is working (YYYYMMDD compared to DD.MM.YYYY')
LET v_current_date = PEEK('Versanddatum', 0, 'Ergebnis_#1_Tagessummen');
Does it help in your case too?
looks like Versanddatum2 is in the YYYYMMDD format? but in your QVD Versanddatum_BMW has the decimals.
So don't think you will just be able to date your where clause.
You'll need to use Date# first then date in your where clause
DATE( DATE#(Versanddatum_BMW, 'DD.MM.YYYY'), 'YYYYMMDD')
hope that helps
it works now - but it's very strange and the worst is, I have no idea why it works now and didn't work before ...
I wrapped the date (in the old format 'DD.MM.YYYY') in quoted and in another DATE() function now - that way works.
=> It now looks like >> DATE('$(v_current_date)') <<
That with the decimals could be - but actually I use the very same DATE() function on the very same table twice - first I aggregate the base_file to a table holding all the distinct dates and then I parse that to split the very same base_file into slices - so there's no apparent reason why the results should not be comparable ... I'll try anyway.
Hmm interesting, I was thinking the decimals was causing problems if it wasn't treated the value as a proper number and so failing the date function. If that's not the case though I'm not sure, would be good if you could upload an example or your full script.
As you say should be fine if it's form the same base file
Try the below, as it's a real date field there will be a numerical value underlying, so should be able to use num instead
LET v_current_date = Num(PEEK('Versanddatum2', 0, 'Ergebnis_#1_Tagessummen'));
Drop table Ergebnis_#1_Tagessummen;
// LET v_current_date = DATE('$(v_current_date)', 'YYYYMMDD');
DATE(Versanddatum_BMW, 'YYYYMMDD') as Versanddatum_BMW_3
WHERE Num(Versanddatum_BMW) = '$(v_current_date)'