[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: SQLBase & SQR Help



Scott,
 
Each of the database platforms handle datefields differently.  For SQLBase, if you are selecting a date field from a table, one possible syntax would be:
 
begin-select
@datetochar(datefield, 'dd-Mon-yy') &datefield
from sometable 
end-select 
 
where "datefield" is the column name of the field you're selecting and "&datefield" is any variable name for the converted value.  The string, 'dd-Mon-yy' can of course be any acceptable date format and edits the results.  The value can be printed at the select by including the print expression at the end of the variable, such as
 
@datetochar(datefield, 'dd-Mon-yy') &datefield (+1,1)
 
or, print it somewhere else in the program as usual.
 
Again, this only works for SQLBase.  Oracle, Sybase, and SQLServer (ODBC) are all different.  There are also lots of other ways to select and manipulate these date fields, but this one selects and converts all in one fail swoop.
Hope this helps. 
 
__________________________________
Chris Snow, Integrity Information Services
800-724-5939 pgr.
chris_snow@msn.com
'As knowledge increases, wonder deepens'
                                           Charles Morgan
 
 
-----Original Message-----
From: Scott Gunter <ksgunter@TDYRYAN.COM>
To: Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
Date: Wednesday, January 07, 1998 11:20 PM
Subject: SQLBase & SQR Help

I need to know how to access the current date in an
SQR Batch program that is connecting to a SQLBase
database.

I use SYSDATE in "where" clauses, but it doesn't work
in other contexts.

Thanks in advance for any help.

Scott
ksgunter@tdyryan.com