~openerp-commiter/openobject-addons/trunk-extra-addons

« back to all changes in this revision

Viewing changes to report_auction/report_auction.py

  • Committer: ced
  • Date: 2008-01-08 09:18:48 UTC
  • Revision ID: ced-a6b046cada8a6ffe9df77e9961dc0e1a4666edd1
Change substring to to_char for pg8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
            create or replace view report_auction_object_date as (
172
172
                select
173
173
                   min(l.id) as id,
174
 
                   substring(l.create_date for 10) as date,
 
174
                   to_char(l.create_date, 'YYYY-MM-DD') as date,
175
175
                   sum(l.obj_num) as obj_num,
176
176
                   l.state as state
177
177
                from
178
178
                    auction_lots l
179
179
                group by
180
 
                    substring(l.create_date for 10),l.id,l.state
 
180
                    to_char(l.create_date, 'YYYY-MM-DD'),l.id,l.state
181
181
            )
182
182
        """)
183
183
report_auction_object_date()
210
210
            create or replace view report_auction_estimation_adj_category as (
211
211
                select
212
212
                    min(l.id) as id,
213
 
                   substring(l.create_date for 7)||'-'||'01' as date,
 
213
                   to_char(l.create_date, 'YYYY-MM-01') as date,
214
214
                   l.state as state,
215
215
                   l.lot_type as lot_type,
216
216
                   sum(l.lot_est1) as lot_est1,
220
220
                    auction_lots l,auction_dates m
221
221
                where l.auction_id=m.id
222
222
                group by
223
 
                    substring(l.create_date for 7),l.state,lot_type
 
223
                    to_char(l.create_date, 'YYYY-MM-01'),l.state,lot_type
224
224
            )
225
225
        """)
226
226
report_auction_estimation_adj_category()