Solved

IDC, HTX(Ms access)

Posted on 1997-04-28
6
253 Views
Last Modified: 2013-12-25
Question- formatting idc returned variables?

I am wondering whether there's any way to format, the returned variable's from the database(Ms access, IIS).
example.. if the returned var is %start date% and when I print it, it looks like 1899:12:12 14:34:23

is there any way to print only the 14:34:23 part
does anyone know SQL code to accomplish this?
I know that ltrim and rtrim does it in SQL, But how do i write that in idc-sql format?
0
Comment
Question by:anusha
  • 3
  • 3
6 Comments
 

Accepted Solution

by:
nodas earned 100 total points
ID: 1854140
Try this

SELECT field1, field2,..., FORMAT(DateField, "hh:nn:ss") AS NewDate, ....
FROM Table1
WHERE ...

Good Luck !
0
 

Author Comment

by:anusha
ID: 1854141
Thanks for helping out.
But you answer didn't quite work .(its giving me query errors)
Can you help ?

here's my actual idc file.

Datasource: HELP_DSK
Template: try.htx
DefaultParameters: Caller Name=%%
SQLStatement:
+Select "Ticket Number", "Department", "Caller ID", "Caller Name", FORMAT(Start Date,"hh:nn:ss") AS NewDate, "Start Time", "Problem Description", "Problem Resolution", "Severity", "Status", "Close Date", "Close Time", "Request Type", "AssignTo" +From "Table - Help Desk"
+Where "Caller Name" LIKE '%Caller Name%%'
#IDC-Search FrontHTM-try.htm ReportHTX-try.htx

also i tried all possible combinations of
FORMAT(Start Date,"hh:nn:ss") AS NewDate
FORMAT("Start Date","hh:nn:ss") AS "NewDate"

none worked!
0
 

Expert Comment

by:nodas
ID: 1854142
Sorry anusha, You're right
The following works fine (I've tested):
Format$([StartDate], 'hh:nn:ss') AS NewDate

...nodas
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:anusha
ID: 1854143
Nodas..

I tried this:
Format$([StartDate], 'hh:nn:ss') AS NewDate

But I am not getting any results from it.. as in the it prints an empty space!(atleast it doesn't give me query errors now)

Can u help please?
Thanks!
Anusha.
0
 

Expert Comment

by:nodas
ID: 1854144
Just one question :
  Does your .htx file contains Newdate variable ? :
 
Try.htx
-------
  <HTML><HEAD>
  ...
  Ticket Number : <%Ticket Number%> <BR>
  DepartmentDate: <%DepartmentDate%><BR>
  ...
  Date          : <%Newdate%>  
  ...
  </Body></Html>

TIME FORMAT (from Access Help)
h      Hour in one or two digits, as needed (0 to 23).
hh      Hour in two digits (00 to 23).
n      Minute in one or two digits, as needed (0 to 59).
nn      Minute in two digits (00 to 59).
s      Second in one or two digits, as needed (0 to 59).
ss      Second in two digits (00 to 59).

Hope this helps !
0
 

Author Comment

by:anusha
ID: 1854145
Thanks Nodas :-)

Ur answer worked! I really appriciate it
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Magento: different theme for Pc and for mobile devices 4 80
Please explain purpose of GZIP 4 61
Print a <div></div> only 5 40
Getting robots.txt Error 9 26
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question