NetTalk Central

Author Topic: Using SQL() as filter in a browse  (Read 3592 times)

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Using SQL() as filter in a browse
« on: June 26, 2012, 04:51:19 AM »
Hi

Trying to use the SQL(My sql-filter) as filter in a browse, but with no luck.
Am I doing something wrong? Isn't possible?

Regards Niels

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Using SQL() as filter in a browse
« Reply #1 on: June 26, 2012, 05:24:56 AM »
not much to go on Niels....
perhaps more info required...

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Using SQL() as filter in a browse
« Reply #2 on: June 26, 2012, 09:32:42 AM »
Of course Bruce.
 I just hoped for a simple answer ;-)

I have this table (the Clarion way)

Daekningskalender    FILE,DRIVER('MSSQL'),OWNER(GLO:Owner),NAME(GLO:Daekningskalender_Name),PRE(DAEKAL),CREATE, |
  BINDABLE,THREAD                                          !                   
SystemID_                KEY(DAEKAL:SystemID),NAME('DAEKAL_SystemID'),NOCASE,PRIMARY !                   
Indsatsstyrke_           KEY(DAEKAL:Indsatsstyrke),DUP,NAME('DAEKAL_Indsatsstyrke'),NOCASE !                   
Person_Tidspunkt_        KEY(DAEKAL:Person,DAEKAL:Tidspunkt),NAME('DAEKAL_Person_Tidspunkt'),NOCASE !                   
Record                   RECORD,PRE()
SystemID                    LONG                           !                   
Tidspunkt                   STRING(8 )                      !                   
TidspunktGroup              GROUP,OVER(Tidspunkt)          !                   
TidspunktDato                 DATE                         !                   
TidspunktTid                  TIME                         !                   
                            END                            !                   
Person                      LONG                           !                   
Funktionsniveau             LONG                           !                   
DaekningsprofilRef          LONG                           !                   
Korekort                    LONG                           !                   
Indsatsstyrke               LONG                           !                   
EkstraVagt                  LONG                           !                   
                         END
                     END


... this table the MSSQL way

CREATE TABLE [dbo].[Daekningskalender_](
   [SYSTEMID] [int] NOT NULL,
   [TIDSPUNKT] [datetime] NOT NULL,
   [PERSON] [int] NOT NULL,
   [FUNKTIONSNIVEAU] [int] NULL,
   [DAEKNINGSPROFILREF] [int] NULL,
   [KOREKORT] [int] NULL,
   [INDSATSSTYRKE] [int] NOT NULL,
   [EKSTRAVAGT] [int] NULL,
PRIMARY KEY CLUSTERED
(
   [SYSTEMID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
   [PERSON] ASC,
   [TIDSPUNKT] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]


In a normal NTWS Browse i put this filter : 'SQL([INDSATSSTYRKE]=1)'

If I look at the filter from the DebugView'er it looks fine, but no records in the Browse. Using the filter in a SQL query I get all my records.

Thats it.

/Niels

estadok

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • EstaSoft
    • Email
Re: Using SQL() as filter in a browse
« Reply #3 on: June 26, 2012, 08:49:59 PM »
Hi Niels!

try without [] and see... Run SQL Server Management Studio and execute query like this "Select * from Daekningskalender_ where INDSATSSTYRKE = 1" If it works then you wrong with SQL() :-)
Clarion 9.0.10376
NetTalk 7.26
SecWin 6.25
StringTheory 1.92

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Using SQL() as filter in a browse
« Reply #4 on: June 28, 2012, 03:13:50 AM »
Tryed it, but same result. My filter works fine in the SQL Server Management Studio - with or without the [].
But thanks!