Skip to content
Advertisement

Tag: sql

SQLSRV skips a row when returning a query

The code above does what I want and returns number of rows that matches what the query returns. However, I hardcoded the three sqlsrv_next_result($result);. The query will change depending on @AmbassadorID, so that piece needs to be dynamic. I tried the following loop: But this loop skips the first row. How do I fix this? Thanks! Answer Use sqlsrv_has_rows(). This

select and count devices at a location based on coordinates of both

By using STContains function of SQL geography it was possible to calculate if a set of coordinates is within an area , however this revealed that if last received coordinates were just outside the area than these coordinates do not match any location. What would be an efficient way to display how many and which devices (out of 4000) are

SQL Server Time Format is not equal to Client Side Time format

I’m trying to compare the client side time format (“14:00”) to SQL Server time format (“14:00:00.0000000″) with SQL Query, technically is not equal because SQL Server time format has seconds and milliseconds, so I tried to concatenate the seconds and milliseconds to client side time format in PHP script like this 14:00.”:00.0000000″ and yet is not equal to SQL Server

Advertisement