6
Answers

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

Photo of Goran Bibic

Goran Bibic

7y
942
1
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)