NetTalk Central

Author Topic: SQL Filter for the browse  (Read 3939 times)

ntnewbies

  • Full Member
  • ***
  • Posts: 184
    • View Profile
    • Email
SQL Filter for the browse
« on: January 18, 2018, 09:45:15 AM »
Hi friends,
i have a database called Tips. I need to get a random record from the database with the filter of category field.

if i put the following line in sql, i get the value that i want:

SELECT TOP 1 TPI_TipsID FROM dbo.Tips where tpi_category = 'events' ORDER BY NEWID()

How do i put the above line into the NetWebBrowse filter?

If i put it like the following, it doesnt work:

LOC:FilterWas = SQL('SELECT TOP 1 TPI_TipsID FROM dbo.Tips where tpi_category = 'events' ORDER BY NEWID()')

How do i go about it?

I have tried PROP:SQL like below but how to get the value out of it?

Tips{PROP:Sql}= 'SELECT TOP 1 TPI_TipsID FROM dbo.Tips ORDER BY NEWID()'
Next(Tips)
LOC:No = TPI:TipsID