How to Query Active and Inactive Cards

Below are query examples that you can enter in the Advanced Filter of the Personnel Manager module to return active and inactive cards.

 

Returning Active Cards

Below is an example of how to return all active cards by taking the modulus of the User_Flag to tell us if Bit 1 is set to 1.

SQL Server Example 

[User_Flag] % 2= 1

 

SQL Server with GetDate() Example

[User_Flag] % 2 = 1 and [de_activate_date] > GetDate() and [activate_date] <= GetDate() 

 

MS Access Example 

[User_Flag] MOD 2= 1

 

MS Access with Date() Example 

[User_Flag] MOD 2 = 1 and [de_activate_date] > Date() and [activate_date] <= Date()


 

Returning Inactive Cards

Below is an example of how to return all inactive cards by taking the modulus of the User_Flag to tell us if Bit 1 is 0.

 

SQL Server Example 

[User_Flag] % 2= 0

 

MS Access Example 

[User_Flag] MOD 2= 0