Select to view content in your preferred language

Mobile or File Geodatabase Views: Grab earliest record of each day using only a datetime field?

216
10
Jump to solution
Monday
AlfredBaldenweck
MVP Regular Contributor

Pretty much what the title says.

I have a dataset with 100,000 records, each one taken about every 15 minutes. I only need one per day for most cases.

I'd like to make a view to grab just one record per day.

Since I have to update/overwrite this table pretty frequently, I don't want to add a "date" field to make this work, because then I'm going to have to do it each time.

I'd like to use a file geodatabase, but those are extremely touchy so I'm experimenting with a mobile gdb instead.

The general flow is select the min timestamp from each day, grouping by day, then joining that to the main table where the objectIDs or something match.

What I can't figure out is how to cleanly get DATE from a DATETIME. I've tried sqlite's format  and date() functions with no luck.

 

Does anyone know how to do this?

Thanks!

 

0 Kudos
10 Replies
JoshuaBixby
MVP Esteemed Contributor

It helps to:

  1. Provide your data schema (field names, data types, etc...), or at least the relevant parts
  2. Even better, provide sample data.  If sharing data itself isn't possible, create an example dataset that can be shared.
  3. Share code snippets of what has been tried so far
  4. Share expected result and what results you are currently getting.