Solved

IDC, HTX(Ms access)

Posted on 1997-04-28
6
248 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
razorCMS: Change Menu Font 4 60
What about 192.168.1.0/28 3 44
Accurate Analytics (Not Google) 2 41
QQ problem 22 23
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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).

777 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