var fromUnixTime="123"; var toUnixTime="123"; var sqlquery = @" SELECT player.id, TO_TIMESTAMP(player.""createTime"")::DATE as ""Дата регистрации"", TO_TIMESTAMP(payment.""createTime"")::DATE as ""Дата платежа"", payment.""currencyAmount"" as ""Бабки"", TO_TIMESTAMP(payment.""rollbackTime"")::DATE as ""Дата возврата бабок"" FROM player LEFT JOIN payment ON payment.""playerId"" = player.id WHERE payment.""currencyAmount"" <> 0 AND (player.""createTime"" >= "+fromUnixTime+" AND player.""createTime"" <= " + toUnixTime+")"; 

The system swears on the last line. Tell me what's the problem

enter image description here

    1 answer 1

    You forgot to put the @ character in front of the line. Correct so:

     ... +fromUnixTime+@" AND player.""createTime"" <= " + toUnixTime+")"; 

    either so:

     ... +fromUnixTime+" AND player.\"\"createTime\"\" <= " + toUnixTime+")"; 
    • there is probably a backslash: s - Buka
    • @Buka That's right. A typo. - D .Stark pm
    • The @ symbol in front of a string literal disables the escape sequences. Double quotes are recognized as single quotes. After breaking the literal with the + operator, you need to put @ again so that everything is "as before." - D .Stark