Sequelize with tedious adding timezone and milisseconds to the value passed to where clause

44 views
Skip to first unread message

Rodrigo Rocha

unread,
Feb 3, 2018, 12:31:00 PM2/3/18
to tedious
Hello,

I am getting no results in sql query because the filter in where clause was changed by sequelize/tedious before query is executed.

const query = `SELECT field FROM Table WITH(NOLOCK) WHERE CreationDate BETWEEN '${startDate}' AND '${endDate}'`

return sequelize.rawQuery(query)
   
.then((resultado) => {
       
return resultado;
   
})
   
.catch((error) => {
        console
.log('error')
   
});



This is the query generated by sequelize/tedious

SELECT [Field]
     FROM
[Table] AS [Table]
WHERE
   
([Table].[CreationDate] > N'2018-02-01 16:36:00.000 -02:00'
AND
[Table].[CreationDate] < N'2018-02-01 16:46:00.000 -02:00')



Can you help me how to solve this? 
CreationDate is stored as YYYY-MM-DD HH:MM:SS


Tito

unread,
Nov 14, 2018, 10:56:53 AM11/14/18
to tedious
I have been using mssql
Module bus tedious
Was exactly that = tedious
Reply all
Reply to author
Forward
0 new messages