Concatenate and format dates...HELP!!

Concatenate and format dates...HELP!!

Post by QL Syste » Sun, 31 Dec 1899 09:00:00



I  have two datefields(not timedatefields): Table1.StartDate and
Table1.Enddate.  I want to
concatenate them so that they are displayed on a form and in a QuickReport
as:
   "Wednesday, 20 August to Friday,22 August 1997"
where Table1.StartDate is 20 August and Table1.Enddate is 22 August
Have tried every variation I can think of of formatting, but can't find
the one I need. Does
anyone have an answer? (BTW also need to do the same for two
timefields(again not
datetimefields).  Tables are local paradox 5.0 and am using Delhi 1.0.
TIA
Mike Higney

 
 
 

Concatenate and format dates...HELP!!

Post by Matthew J. Broc » Sun, 31 Dec 1899 09:00:00


 Mike,
In your OnCreate event of your form, you need to set the ShortDateFormat to:
'dddd, dd mmmm yyyy'. This will give you the display of "Sunday, 17 August
1997".

To give you your date range display, you need to extract all but the year
from the first date and concatenate it with the second date and it will look
fine.

I am sending you a sample project via private email that shows what I mean.
Hopefully it will be more clear than the explanation! :)
----------------------------------------------------------------

Computer Solutions:AZ
Tucson, AZ

TVisualBasic:=class(None);

QL Systems wrote in article

>I  have two datefields(not timedatefields): Table1.StartDate and
>Table1.Enddate.  I want to
>concatenate them so that they are displayed on a form and in a QuickReport
>as:
>   "Wednesday, 20 August to Friday,22 August 1997"
>where Table1.StartDate is 20 August and Table1.Enddate is 22 August
>Have tried every variation I can think of of formatting, but can't find
>the one I need. Does
>anyone have an answer? (BTW also need to do the same for two
>timefields(again not
>datetimefields).  Tables are local paradox 5.0 and am using Delhi 1.0.
>TIA
>Mike Higney



 
 
 

Concatenate and format dates...HELP!!

Post by David Arnal » Sun, 31 Dec 1899 09:00:00


Try

  with Table1 do
label1.caption := formatDateTime('dddd, d mmmm yyyy',
FieldByName('StartDate').AsDateTime) + ' to ' +
formatDateTime('dddd, d mmmm yyyy', FieldByName('EndDate').AsDateTime)

HTH
David


>I  have two datefields(not timedatefields): Table1.StartDate and
>Table1.Enddate.  I want to
>concatenate them so that they are displayed on a form and in a QuickReport
>as:
>   "Wednesday, 20 August to Friday,22 August 1997"
>where Table1.StartDate is 20 August and Table1.Enddate is 22 August
>Have tried every variation I can think of of formatting, but can't find
>the one I need. Does
>anyone have an answer? (BTW also need to do the same for two
>timefields(again not
>datetimefields).  Tables are local paradox 5.0 and am using Delhi 1.0.
>TIA
>Mike Higney


 
 
 

1. Date Time format to Date format

Hi All,
I havea field logtime with datetime datatype. I would like to remove
the time part and then group by date, however whether i remove the
time part or not, i get the same results. I m givng the code below to
convert the date, can anyone plz help? many thanks
select convert(datetime,Convert(varchar(10),logtime,102)),totals from
total t INNER JOIN log t ON blah blah group BY
convert(datetime,Convert(varchar(10),logtime,102)),totals

thanks
ben

2. insert & retrieve picture in oracle 7

3. Concatenate Date fields(PLEASE HELP)

4. 4gl hptoday users

5. Formatted concatenated cells

6. DTS Wizard

7. Dates Format: Trouble giulian format (long numeric value)

8. Pick O/S Network Administrator

9. Formatting the date format without doing it in the cinnection string

10. Converting Unix Date/time format into SQL readable format

11. Date Formats in Tables (Wrong International Format)

12. HELP: SQL Server 6.5 Date Formats...