Goran Bibic

Goran Bibic

  • 484
  • 2.9k
  • 196.8k

Select, Sum, convert...varchar to float?

Apr 30 2018 3:11 PM
Try...
 
Msg 1035, Level 15, State 10, Line 13
Incorrect syntax near 'cast', expected 'AS'.
 
  1. select [iznos_sa_pdv], sum(cast(Try_convert(float,[iznos_sa_pdv]))) AS ukupno  
  2. from mp_kasa_lista  
  3.  WHERE [datum] >= CONVERT(datetime, convert(varchar(10), GETDATE() ,120), 120)  
  4. AND   datum <  DATEADD(day, 1, convert(datetime, convert(varchar(10), getdate(), 120), 120))  
  5. group by iznos_sa_pdv 
 Some help?
 
I need sum of column iznos_sa_pdv type varchar 255...where condition is ok

Answers (6)