Page 1 of 1 1
Topic Options
#117802 - 2004-04-13 07:34 PM dbgetrecordset -> MAX(DateTime) -> output ??
Trackz Offline
Fresh Scripter

Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
Hi,
I'm using kix together with a MySQL db.
Am able to retrieve, and add values to a table without any problems.

Only the query below doesn't seem to work.
I'm trying to find the last Datetime for a user in the table.
The workstation value can be found numerous time, only the DateTime differs per record
I'm using this query below, but i'm not able to output the found data

This query works fine using a SQL query tool. (also tried to use Max(DateTime) as Time, but.. no go..
Any idea how to fix this?

$recordset = DBGetRecordset($objConn,"SELECT MAX(DateTime) FROM hardware WHERE Workstation='PCName'")

$RC=MessageBox("Last Time: $DateTime","SQl Retrieved Data",48)



Thanx in advance

Tim

Top
#117803 - 2004-04-13 07:43 PM Re: dbgetrecordset -> MAX(DateTime) -> output ??
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Does the query work if you omit the MAX? Is there an error code being returned?
_________________________
There are two types of vessels, submarines and targets.

Top
#117804 - 2004-04-13 07:57 PM Re: dbgetrecordset -> MAX(DateTime) -> output ??
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What if you reverse the quotes to single outside, double inside?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117805 - 2004-04-13 09:38 PM Re: dbgetrecordset -> MAX(DateTime) -> output ??
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Les has a good point. I know I have to use the single-double rule with WMI queries...

Code:

$recordset = DBGetRecordset($objConn,'SELECT MAX(DateTime) FROM hardware WHERE Workstation="PCName"')


Top
#117806 - 2004-04-14 10:05 AM Re: dbgetrecordset -> MAX(DateTime) -> output ??
Trackz Offline
Fresh Scripter

Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
That didn't work for me.
Don't know what my mistake was, but when retyping the 2 lines, it suddenly worked. weird, but thanx.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 988 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.051 seconds in which 0.021 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org