Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed translated content for 'zh'
Sv translation
languageen

Date and Time Variables

If you need to change the SQL query dynamically, you can use predefined variables. BellaDati currently supports functions to get date, time or timestamp in user defined formats:

Name

Description

Examples

$date(dateString)

Evaluates the dateString and outputs the date in yyyy-MM-dd format. The dateString

$date(now + 5d -4w)
$date(2011-01-01 + 5d -4w)
$date(actualMonth -1d)

$date(dateString, format)

Works like $date(dateString), but output format is controlled by format parameter

$date(now + 5d -4w, dd-MM-yyyy)
$date(2011-01-01 + 5d -4w, MMyyyy)
$date(actualMonth -1d, yyyy-dd-MM)

$time(timeString)

Evaluates the timeString and outputs the resulting time in HH:mm:ss format

$time(now)
$time(actualhour)
$time(actualminute)

$time(timeString, format)

Works like $time(timeString), but output format is controlled by format parameter

$time(now, HH:mm:ss)
$time(actualhour, MMss)
$time(actualminute, HHmmss)

$timestamp()

Returns the current time stamp value

$timestamp()
$lastSuccessfulImport()
Returns time stamp with last successful import
$lastSuccessfulImport()

$firstValue(L_ATTRIBUTE_CODE)

Returns the lowest value (sorted ascending) of the attribute specified by attribute ID stored in the current data set.

Returns empty string if there are no data or the attribute code is not valid.

$firstValue(L_ID) //returns 123456

$firstValue(L_DATE_ATTRIBUTE) //returns 2013-01-01
$firstValue(L_TIME_ATTRIBUTE) //returns 10:00:54

$lastValue(L_ATTRIBUTE_CODE)

Returns the highest value (sorted descending) of the attribute specified by attribute ID stored in the current data set.

Returns empty string if there are no data or the attribute code is not valid.

$lastValue(L_ID) //returns 123456

$lastValue(L_DATE_ATTRIBUTE) //returns 2013-12-31
$lastValue(L_TIME_ATTRIBUTE) //returns 23:59:59
$firstValue(DATASET_CODE, L_ATTRIBUTE_CODE)Returns the lowest value (sorted ascending) of the attribute specified by attribute ID stored in the referenced data set.$firstValue(NEW_DATA_SET__SQL_DATABAS_4, L_ATT)
$lastValue(DATASET_CODE, L_ATTRIBUTE_CODE)Returns the highest value (sorted descending) of the attribute specified by attribute ID stored in the referenced data set.$lastValue(NEW_DATA_SET__SQL_DATABAS_4, L_ATT)
Note

When using the variables in the SQL query, you should make sure that the variable is placed in the quotes, so it will be used as string.

 

An example of such a condition can be: WHERE id > '$lastValue(L_ID)'

DateString

  • now - represents actual date
  • actualyear - represents the first day of actual year (1.1.20XX). For example actualyear selected on 21.9.2010 represents date 1.1.2010
  • actualquarter - represents the first day of actual quarter (1.1.20XX, 1.4.20XX, 1.7.20XX, 1.10.20XX). For example actualquarter selected on 21.9.2010 represents date 1.7.2010
  • actualmonth - represents the first day of actual month (1.1.20XX, 1.2.20XX, ...). For example actaulmonth selected in 21.9.2010 represents date 1.9.2010
  • actualweek - represents first day of actual week (Monday). For example actualweek selected on 21.9.2010 represents date 20.9.2010 (Monday of this week in calendar)
  • availableFrom, availableTo - represents the first and last available date entry
  • relative and absolute enterig of date can be adjusted by operators using this syntax: date +|- n[d|w|m|q|y], where n is integer, d represents day, w represents week, m represents month q represents quartal and y represents year. We can for example define time in this way:  actualyear + 2m -4d. Today is 21.9.2010, so this value represents 1.1.2010 + 2 months - 4 days, which means date 25.2.2010.

TimeString

  • now - represents actual time
  • actualhour - represents the actual hour at 0 minutes and 0 seconds.
  • actualminute - represents the actual minute at 0 seconds
  • actualsecond - represents the actual second
Sv translation
languagesk

Premenné času a dátumu

Ak potrebujete rýchlo zmeniť SQL query môžete použiť preddefinované premenné. BellaDati podporuje funkcie na získanie dátumu, častu alebo timestampu-u v použivateľom definovaných formátoch.

Názov

Popis

Príklady

$date(dateString)

Vyhodnotí dateString a podá dátum vo formáte rrrr-MM-dd .

$date(now + 5d -4w)
$date(2011-01-01 + 5d -4w)
$date(actualMonth -1d)

$date(dateString, format)

Funguje rovnako ako $date(dateString), ale výstupný formát je možné ovplyvniť pomocou parametru format

$date(now + 5d -4w, dd-MM-yyyy)
$date(2011-01-01 + 5d -4w, MMyyyy)
$date(actualMonth -1d, yyyy-dd-MM)

$time(timeString)

Vyhodnotí timeString a podá výsledný čas vo formáte HH:mm:ss

$time(now)
$time(actualhour)
$time(actualminute)

$time(timeString, format)

Funguje rovnako ako $time(timeString), ale výsledný formát je možné kontrolovať pomocou parametru format

$time(now, HH:mm:ss)
$time(actualhour, MMss)
$time(actualminute, HHmmss)

$timestamp()

Vráti súčasnú hodnotu timestamp-u

$timestamp()

$firstValue(L_ATTRIBUTE_CODE)

Vráti najnižsiu hodnotu (radenú vzostupne) atribútu špecifikovaného pomocou attribute ID uloženého v danej skupine dát.

V prípade, že neexistujú žiadne dáta alebo je kód atribútu neplatný vráti prázdny string.

$firstValue(L_ID) //returns 123456

$firstValue(L_DATE_ATTRIBUTE) //returns 2013-01-01
$firstValue(L_TIME_ATTRIBUTE) //returns 10:00:54

$lastValue(L_ATTRIBUTE_CODE)

Vráti najvyššiu hodnotu (radenú zostupne) atribútu špecifikovaného pomocou attribute ID uloženú v danej skupine dát.

V prípade, že neexistujú žiadne dáta alebo je kód atribútu neplatný vráti prázdny string.

$lastValue(L_ID) //returns 123456

$lastValue(L_DATE_ATTRIBUTE) //returns 2013-12-31
$lastValue(L_TIME_ATTRIBUTE) //returns 23:59:59

DateString

  • now - predstavuje súčasný dátum
  • actualyear - predstavuje prvý deň súčasného roku (1.1.20XX). Napríklad actualyear zadaný 21.9.2010 zobrazí dátum 1.1.2010.
  • actualquarter - predstavuje prvý deň súčasného kvartálu (1.1.20XX, 1.4.20XX, 1.7.20XX, 1.10.20XX). Napríklad actualquarter zadaný 21.9.2010 zobrazí dátum 1.7.2010
  • actualmonth - predstavuje prvý deň súčasného mesiaca (1.1.20XX, 1.2.20XX, ...). Napríklad actaulmonth zadaný  21.9.2010 zobrazí dátum 1.9.2010
  • actualweek - predstavuje prvý deň súčasného týždňa. Napríklad actualweek zadaný 21.9.2010 zobrazí dátum 20.9.2010 (Pondelok daného týždňa)
  • availableFrom, availableTo - predstavuje prvý a posledný dátum, v ktorom je dostupný nejaký záznam
  • relatívne a absolútne zadanie dátumu sa dá prispôsobiť pomocou operátorov za použitia tohto zloženia: dátum +|- n[d|w|m|q|y], kde n is celé číslo, d predstavuje deň, w týždeň, m mesiac, q kvartál a predstavuje rok. Čas teda napríklad môžme definovať takto: actualyear + 2m -4d. Dnes je 21.9.2010, takže táto skladba predstavuje  1.1.2010 + 2 mesiace - 4 dni, výsledný dátum teda bude 25.2.2010.

TimeString

  • now - predstavuje súčasný čas
  • actualhour - predstavuje súčasnú hodinu v čase 0 minút a 0 sekúnd. Napríklad v čase 10:45:32 bude hodnota actualhour 10:00:00.
  • actualminute - predstavuje súčasnú minútu v čase 0 sekúnd.
  • actualsecond - predstavuje súčasnú sekundu
Sv translation
languageja

日付と時刻の変数

SQLクエリーを動的に変更する必要がある場合、事前定義された変数を使用できます。BellaDatiは現在、日付、時刻、タイムスタンプをユーザー定義の形式で取得する関数をサポートしています:

名前

説明

$date(dateString)

ddateStringを評価し、日付をyyyy-MM-dd形式で出力します。dateString

$date(now + 5d -4w)
$date(2011-01-01 + 5d -4w)
$date(actualMonth -1d)

$date(dateString, format)

$date(dateString)と同様に機能しますが、出力形式はformatパラメーターによって制御されます。

$date(now + 5d -4w, dd-MM-yyyy)
$date(2011-01-01 + 5d -4w, MMyyyy)
$date(actualMonth -1d, yyyy-dd-MM)

$time(timeString)

timeStringを評価し、結果時間をHH:mm:ss形式で出力します。

$time(now)
$time(actualhour)
$time(actualminute)

$time(timeString, format)

$time(timeString)と同様に機能しますが、 出力形式はformatパラメーターによって制御されます。 

$time(now, HH:mm:ss)
$time(actualhour, MMss)
$time(actualminute, HHmmss)

$timestamp()

現在のタイムスタンプ値を返します。

$timestamp()
$lastSuccessfulImport()
最後に成功したインポートのタイムスタンプ値を返します。
$lastSuccessfulImport()

$firstValue(L_ATTRIBUTE_CODE)

現在のデータセットに格納されている属性 IDによって指定された属性の最小値(昇順)を返します。

データがないか、属性コードが無効である場合、空の文字列を返します。

$firstValue(L_ID) //returns 123456

$firstValue(L_DATE_ATTRIBUTE) //returns 2013-01-01
$firstValue(L_TIME_ATTRIBUTE) //returns 10:00:54

$lastValue(L_ATTRIBUTE_CODE)

現在のデータセットに格納されている属性 IDによって指定された属性の最大値(降順)を返します。

データがないか、属性コードが無効である場合、空の文字列を返します。

 

$lastValue(L_ID) //returns 123456

$lastValue(L_DATE_ATTRIBUTE) //returns 2013-12-31
$lastValue(L_TIME_ATTRIBUTE) //returns 23:59:59
$firstValue(DATASET_CODE, L_ATTRIBUTE_CODE)

参照されるデータセットに格納されている属性IDで指定された属性の最小値(昇順)を返します。

 

$firstValue(NEW_DATA_SET__SQL_DATABAS_4, L_ATT)
$lastValue(DATASET_CODE, L_ATTRIBUTE_CODE)

参照されるデータセットに格納されている属性IDで指定された属性の最大値(降順)を返します。

$lastValue(NEW_DATA_SET__SQL_DATABAS_4, L_ATT)
Note

SQLクエリーで変数を使用する場合、変数が引用符で囲まれていることを確認する必要があります。そのため、変数は文字列として使用されます。

 

そのような条件の例は次の通りです: WHEREid> '$ lastValue(L_ID)'


DateString

  • now – 日付を表します。
  • actualyear – 年の最初の日を表します(20XX.1.1) 例えば、2010.9.21で選択されたactualyearは、日付2010.1.1を表します。
  • actualquarter 四半期の最初の日を表します(20XX.1.1, 20XX.4.1, 20XX.7.1, 20XX.10.1)。例えば、20109.21で選択されたactualquarterは、日付2010.7.1を表します。
  • actualmonth 月の最初の日を表します(20XX.1.1, 20XX.2.1, ...)。例えば、2010.9.21で選択されたactaulmonthは、日付2010.9.1を表します。
  • actualweek 週の最初の日を表します(月曜日) 例えば、2010.9.21で選択されたactualweekは、日付2010.9.20(この週の月曜日)を表します。
  • availableFrom, availableTo – 利用可能な最初と最後の日付エントリを表します。
  • 日付の相対および絶対入力は、次の構文を使って演算子で調整できます: date +|- n[d|w|m|q|y] nが整数、dは日、 wは週、mは月、qは四半期、yは年を表します。例えばこのように時間を定義できます:  actualyear + 2m -4d今日は2010.9.21であるとすると、この値は2010.1.1 + 2か月 - 4日、つまり日付は2010.2.25を表します。

TimeString

  • now – 時刻を表します。
  • actualhour 時間を00秒で表します。
  • actualminute 分を0秒で表します。
  • actualsecond 秒を表します。
Sv translation
languagede

 Datums- und Zeitvariablen

Wenn Sie die SQL-Abfrage dynamisch ändern müssen, können Sie vordefinierte Variablen verwenden. BellaDati unterstützt derzeit Funktionen zum Abrufen von Datum, Uhrzeit oder Zeitstempel in benutzerdefinierten Formaten:

Name

Beschreibung

Beispiel

$date(dateString)

Evaluates the dateString and outputs the date in yyyy-MM-dd format. The dateString

$date(now + 5d -4w)
$date(2011-01-01 + 5d -4w)
$date(actualMonth -1d)

$date(dateString, format)

Works like $date(dateString), but output format is controlled by format parameter

$date(now + 5d -4w, dd-MM-yyyy)
$date(2011-01-01 + 5d -4w, MMyyyy)
$date(actualMonth -1d, yyyy-dd-MM)

$time(timeString)

Evaluates the timeString and outputs the resulting time in HH:mm:ss format

$time(now)
$time(actualhour)
$time(actualminute)

$time(timeString, format)

Works like $time(timeString), but output format is controlled by format parameter

$time(now, HH:mm:ss)
$time(actualhour, MMss)
$time(actualminute, HHmmss)

$timestamp()

Returns the current time stamp value

$timestamp()
$lastSuccessfulImport()
Returns time stamp with last successful import
$lastSuccessfulImport()

$firstValue(L_ATTRIBUTE_CODE)

Returns the lowest value (sorted ascending) of the attribute specified by attribute ID stored in the current data set.

Returns empty string if there are no data or the attribute code is not valid.

$firstValue(L_ID) //returns 123456

$firstValue(L_DATE_ATTRIBUTE) //returns 2013-01-01
$firstValue(L_TIME_ATTRIBUTE) //returns 10:00:54

$lastValue(L_ATTRIBUTE_CODE)

Returns the highest value (sorted descending) of the attribute specified by attribute ID stored in the current data set.

Returns empty string if there are no data or the attribute code is not valid.

$lastValue(L_ID) //returns 123456

$lastValue(L_DATE_ATTRIBUTE) //returns 2013-12-31
$lastValue(L_TIME_ATTRIBUTE) //returns 23:59:59
Note

Wenn Sie die Variablen in der SQL-Abfrage verwenden, sollten Sie sicherstellen, dass die Variable in Anführungszeichen gesetzt wird, damit sie als Zeichenfolge verwendet wird.
 

Ein Beispiel für eine solche Bedingung kann sein: WHERE id> '$ lastValue (L_ID)'

DateString

  • now - repräsentiert das aktuelle Datum
  • actualyear - repräsentiert den ersten Tag des tatsächlichen Jahres (1.1.20XX). Beispielsweise repräsentiert das am 21.9.2010 ausgewählte aktuelle Jahr das Datum 1.1.2010
  • actualquarter - stellt den ersten Tag des tatsächlichen Quartals dar (1.1.20XX, 1.4.20XX, 1.7.20XX, 1.10.20XX). Beispielsweise entspricht das am 21.9.2010 ausgewählte aktuelle Quartal dem Datum 1.7.2010
  • actualmonth - stellt den ersten Tag des aktuellen Monats dar (1.1.20XX, 1.2.20XX, ...). Beispiel: tatsächlicher Monat, ausgewählt am 21.9.2010, entspricht dem Datum 1.9.2010
  • actualweek - repräsentiert den ersten Tag der tatsächlichen Woche (Montag). Beispielsweise repräsentiert die am 21.9.2010 ausgewählte tatsächliche Woche das Datum 20.9.2010 (Montag dieser Woche im Kalender)
  • availableFrom, availableTo - represents the first and last available date entry
  • relative and absolute enterig of date can be adjusted by operators using this syntax: date +|- n[d|w|m|q|y], where n is integer, d represents day, w represents week, m represents month q represents quartal and y represents year. We can for example define time in this way:  actualyear + 2m -4d. Today is 21.9.2010, so this value represents 1.1.2010 + 2 months - 4 days, which means date 25.2.2010.

TimeString

  • now - represents actual time
  • actualhour - represents the actual hour at 0 minutes and 0 seconds.
  • actualminute - represents the actual minute at 0 seconds
  • actualsecond - represents the actual second