---
title: "select & timestamp [where]"
url: "https://www.typo3.net/d/72798-select-timestamp-where"
source: "typo3.net"
tags: ["Allgemein","Frage"]
created: "2008-01-23"
last_reply: "2008-01-23"
replies: 5
solved: false
page: 1
pages: 1
lang: "de"
---

# select & timestamp [where]

Allgemein · 5 Antworten · gestartet 2008-01-23

## Eröffnungsbeitrag

**jeppo** · 2008-01-23 · [Beitrag #1](https://www.typo3.net/d/72798-select-timestamp-where/1)

Hallo,

aus eine Tabelle mit der Spalte <date> möchte ich auf die datensätze mit select zugreifen die älter oder gleich sind als das aktuelle timestamp.
Folgende script habe ich geschrieben, es funktioniert es auch solange ich anstatt das dynamische aktuelle timestamp (date:U) einen statisches timestamp manuell schreibe wie z.B. 1201010816. Es muss was mit string zu tun haben, aber irgendwie komme ich nicht dahinter.

Kann mir hier jemand helfen?

```typoscript
...
table = tx_calendar_dates
select {
	pidInList = 337
	where = date >= date:U???
	orderBy = date
	max = 2		
}
...
```

Vielen Dank im Voraus.

mfg

Jeppo

## Antworten

### [#2](https://www.typo3.net/d/72798-select-timestamp-where/2) · just2b · 2008-01-23

where hat kein stdWrap, nimm andWhere

georg
---
edit: fehler korriegiert

### [#3](https://www.typo3.net/d/72798-select-timestamp-where/3) · jeppo · 2008-01-23

Hallo Georg,

auch mit addWhere geht es leider nicht :-(

```typoscript
...
table = tx_calendar_dates
select {
	pidInList = 337
	addWhere = date >= date:U???
	orderBy = date
	max = 2		
}
...
```

### [#4](https://www.typo3.net/d/72798-select-timestamp-where/4) · just2b · 2008-01-23

schmeiss im install tool das sqldebug an, dann siehst du was rauskommt!

aber vom gefühl her wird das nicht umgewandelt

```typoscript
        andWhere {
                data = date:U
                wrap =  date >=|
        }
```

georg

### [#5](https://www.typo3.net/d/72798-select-timestamp-where/5) · jeppo · 2008-01-23

toll den sqldebug kannte ich noch nicht, danke ;-)

In der Tat wurde date:U nicht umgewandelt, im debug stand da "*you have an error in your SQL syntax near ':U*" und als ausgabe stand date:U anstatt den timestamp.
Zum schluss hat aber funktioniert, ich musste nur noch einen Tag abziehen und vorallem **addWhere** in **andWhere** ändern, da hattest du dich vertipt?

```typoscript
...
table = tx_calendar_dates
select {
        pidInList = 337
        andWhere {
        data = date:U-84600
        wrap =  date >=|
        }
        orderBy = date
        max = 2  
}
...
```

Nochmal danke ;-) !

### [#6](https://www.typo3.net/d/72798-select-timestamp-where/6) · just2b · 2008-01-23

jo tippfehler können passieren ;)

georg

---

Quelle: „select & timestamp [where]“, typo3.net, https://www.typo3.net/d/72798-select-timestamp-where
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
