![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Tue, Sep 11 2018 10:52 PM | Permanent Link |
Ian Branch |
Attachments: Screenshot_1.jpg |
Wed, Sep 12 2018 2:47 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Ian
OK 1. a query to get the appropriate row SELECT * FROM table WHERE DTG >= CURRENT_TIMESTAMP RANGE 1 TO 1 or as a parameterised query SELECT * FROM table WHERE DTG >= :Wanted RANGE 1 TO 1 2. some Delphi code query1.close; {only if parameterised query} if not query1.prepared then query1.Prepare; query1.ParamByName('Wanted').AsTimestamp := Now; // or whenever you want query1.ExecSQL; LogEvent := query1.fieldbyname('LogEvent').AsString; LogUser := Copy(LogEvent,6,MaxInt); LogUser := Copy(LogUser,1,Pos('has',LogUser)-1); should do it Roy Lambert |
Wed, Sep 12 2018 7:38 PM | Permanent Link |
Ian Branch |
Attachments: Screenshot_2.jpg |
Thu, Sep 13 2018 2:31 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Ian
If you want pure SQL then you need a script. Export the table data in xml format and email it to me and I'll sort something out. Before I start I need a "specification" or at least a few points clarifying: at any point in time - means to the nearest minute - yes/no Who was logged in at that time - in the example you've shown that translated to who logged in at that time not who logged in earlier and never logged out again. If you want genuine who was logged in then the entire table needs to be scanned for login/logout pairs. - what is the real requirement? Roy Lambert |
Thu, Sep 13 2018 2:47 AM | Permanent Link |
Ian Branch | Hi Roy,
Please see email just sent. Regards, Ian |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |