Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Pervasive.SQL > format date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-10-08, 11:58
randjana randjana is offline
Registered User
 
Join Date: Apr 2008
Posts: 2
format date

How can i format date in pervasive sql?

The day in my table is stored as "yyyymmdd"

I want to search for records with curdate().

select Curdate() returns 'dd/mm/yyyy'

Any help will be appreciated.

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 04-10-08, 17:22
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 813
First, is the date stored in the table as a "Date" data type?
If it is, you'll need to specify the date as 'yyyy-mm-dd'
You'll need to include the single quote. For example:
Code:
select f1 from t1 where datefield = '2008-04-10'
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 04-10-08, 17:36
randjana randjana is offline
Registered User
 
Join Date: Apr 2008
Posts: 2
hello Sir,

Thanks for replying.
My datefield in the table is not a "Date" data type.
IT is "Decimal".I'm not allowed to change it.

I want to run something like this:

select * from test where datefield = curdate()-1
datefield is of DECIMAl datatype and the format of the date is 'YYYYMMDD'.

there are 2 option i think. One i have to convert datefield to a "date" datatype
or convert curdate() to a decimal that displays the date as 'YYYYMMDD' instead of yyyy-mm-dd.

Please help.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On