0

I have a problem with informix database,

I have a log table, like this

name     datetime     event
 A        08:00         1
 B        03:00         2
 A        04:00         3
 C        05:00         4
 V        06:00         1
 A        11:00         7
 etc

NOTE : 1 => LOGIN
       7 => LOGOUT

I want generate a report, like this

name    login     logout
 A      08:00     11:00
 A      11:09     12:00
 etc

I need a query to solved My problem.

2 Answers2

0

First Group by name

  1. create text feilds Login and Logout and place those in group header.

Now in detail add below formulas for login and logout.

login

if event=1
then datetime

Place in detail fo login

logout

if event=7
then datetime

Place in detail of logout

supress group footer

Siva
  • 9,043
  • 12
  • 40
  • 63
0

have a look below link.

Dynamic PIVOT using C# Linq

use parameter as you want to pivot the data.

Community
  • 1
  • 1
J R B
  • 2,069
  • 4
  • 17
  • 32