We Recommend

SQL Cookbook SQL Cookbook
Written in O'Reilly's popular Problem/Solution/Discussion style, the SQL Cookbook is sure to please. Anthony's credo is: "When it comes down to it, we all go to work, we all have bills to pay, and we all want to go home at a reasonable time and enjoy what's still available of our days." The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.


Posted By

assbach on 02/25/07


Tagged

mysql date DateTime currency


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

vali29
heinz1959


SELECT older than x days


Published in: SQL 


2 things here. currency (euro) with in a 2.00 format and select entries older than 4 weeks = 28 days

  1. SELECT
  2. FORMAT(kontoinfo.betrag,2) AS betrag
  3. FROM konto
  4. WHERE user = '".$uid."'
  5. AND konto.datum >= SUBDATE( NOW(), 28)
  6. ORDER BY konto.datum DESC

Report this snippet 

You need to login to post a comment.