?
Solved

IDC, HTX(Ms access)

Posted on 1997-04-28
6
Medium Priority
?
255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 

Accepted Solution

by:
nodas earned 200 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

770 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