Hey, I am having problem while fetching the data from SQL database using MySQL node. The flow i used is attached. The date picker generates the same SQL syntax as the manual entered "from" and "to" date, but the manual one returns the data while the date picker one doesn't.
since they are both running the same function and you are hardcoding the dates, it should be the same. Put a debug node (display complete msg object) of the output of the function node, change the debug on the output of the mysql node to display the complete msg object and run it again.
You might want to add a catch node with a debug node so see if it shows anything,
hard coding of the node is to check the SQL command. The hard coding is commented while using the date picker template. Both hard coding and template generate the same SQL command, but the later returns an empty string.
Actually you can see the output coming out of the MySQL node when used with hard coded date and date picker. both of them returns the same command (for SQL) in the debug node used after the MySQL node. can not figure out what is happening. It works only with hard coded dates.have you checked the flow ?
Your eyes must be better than mine, I can hardly read that, in fact it looks to me as if the BETWEEN is specifying the same date/time for both ends so not likely to find many.
You would have to specify the start of the day and the end of the day to get the data for the day. You are just specifying the start of the day for both.
Change your working one to show the same as the other and see what you get.
Ah, I see you are only storing dates, not date/time.
You still haven't done what has been asked multiple times. Put a debug node showing what is going into the sql node for the working and failing messages. Don't forget to show the complete message. If you can copy/paste the result from the debug window it will be easier to read than a screenshot.
Well I must admit I can't see any difference, assuming that the missing payload is not an issue.
What happens if, in the non-working case, you don't put the WHERE clause in at all so it should return everything?
Also have you told us which mssql node you are using? node-red-contrib-something probably.