Wednesday, October 2, 2013

Pulling a specific query result

I'm building a custom forum for a Swedish website, and I'm writing the part where you've clicked a forum and it's not displaying the top-level posts in the forum, together with some information like when it was posted, how many replies there are and when the last reply was.

I've never needed to do this before, but I needed to pull the last record in the query, or specifically I needed to pull the date when it was posted.

After a bit I came up with this, maybe it'll help someone else needing to do something similar.

LSDateFormat is used because I've previously set SetLocale("Swedish").

Using counter.recordCount gives me the number of results in the query, so here I use it to grab the last record which is the same as the total number.

No rocket-surgery going on, but took me a second to figure out since I haven't needed to pull specific results before.

No comments:

Post a Comment