No I/O assistant indicator data output
Hi there,
have only just started using Labview, so treat me gently
I am using I/O assistant to communicate via. serial (Com1) to a smoke meter and can get all values correctly in setup, but only the first will display on an Indicator.
The command I write is LIS (term \r) and I can Query and Parse several times and each returned data is shown correctly (Will display in Value window). I then generate the VI but cannot get more than one to display in the Indicator I created for them.
With just two Query and Parse commands, I ran NI Spy and both sets of values are shown in the appropriate 'Buffers' but still only the first one will display.
Any ideas?
Cheers,
Hi Hannah,
Yes, the data does show in the i/o assistant, but the second value will not show in the front panel indicator.
I ran in execution highlight and with probes on both outputs, the result is the same. The first output contains the data "Temperature corr.factor : 62548" and this is in the probe as well. But the second probe and indicator remain blank.
The unit is an AVL 415 smoke meter and we do have a manual for it. When connected via. Hyperterminal and a 'LIS' command sent to it, it responds with -
Temperature corr.factor : 62548
Volume corr.factor *1000: 878
Dead volume [ml] : 44
Ambient pressure [mbar] : 980
Nominal volume [ml] : 1000
Sample time [0.1s] : 60
Number of samples : 3
Auto Range min.vol. [ml]: 500
Auto Range max.vol. [ml]: 5000
Extended Purge [0.1s] : 0
Trigger delay [0.1s] : 0
Tolerance [0.01FSN] : 20
Printout: normal
Printout: English
(The values might be different, as is another unit) I am using the smoke meter as a practice and wish to check and display the internal parameters quickly. In the I/O assistant I can put multiple 'Read and Parse' after writing 'LIS'. each one returns correct values as above in order. But only the first one is shown on it's indicator.
Hope thats clear?
Mike
Similar Messages
-
Express DAQ data output to two numerical indicators
Hi,
I'm a complete Labview newbie, so apologies if this is a really obvious question, but after reading through pages of documentation I still can't get anywhere.
I'm using a PCI 6220 data acquisition card, and want to measure 2 independant currents, outputting each value on a seperate numeric indicator.
I used the DAQ assistant, and set up the two signals without too much trouble in the box that appears when you double click the assistant. If I connect the data output on the box diagram to a graph indicator, I can see both signals fine, but I would much prefer a numeric indicator for each signal. I can connect one, and that works fine: displaying the first current measurement I defined, but I can't see any way to get the second current measurement displayed in the same manner.
All help welcome!
Thank youI've attached a screenshot of the VI and the DAQ assistant configuration window thing - hopefully this helps explain what I mean(!)
I don't seem to be able to choose a channel for the numeric indicator?
Attachments:
VI_screenshot1.jpg 366 KB
daq_assist screenshot1.jpg 146 KB -
Hi I am having an issue with the write to file using the NI9219, when i am writing the data from the daq assist both data will output into the excel file but i am also trying to output the time interval at which each set of data points were collected. I was able to do that successfully in the Thermistor Time resp VI but i am unable to do this action with the NI 9219 Module.
also the data does not concatenate in the correct column as well.
If anyone could lend a hand I would be greatly appreciative.
I apologize for the messy VI wiring ahead of time hehe
Attachments:
NI9219 DAQ for 500 Ohm RTD.vi 92 KB
Thermistor Time Resp.vi 65 KB
Test08 Hours 19 Mins 32.xlsx 25 KBDoki86 wrote:
Hi I am having an issue with the write to file using the NI9219, when i am writing the data from the daq assist both data will output into the excel file but i am also trying to output the time interval at which each set of data points were collected. I was able to do that successfully in the Thermistor Time resp VI but i am unable to do this action with the NI 9219 Module.
also the data does not concatenate in the correct column as well.
If anyone could lend a hand I would be greatly appreciative.
I apologize for the messy VI wiring ahead of time hehe
You are missing a few basics here.
the ULx Driver is for controlling hardware DAQ devices offered by MCC
the 9219 is a cDAQ device from NI and uses DAQmx as the driver
They are not interchangable.
Jeff -
Report is executing in background and need data(output) in excel format
Report is executing in background and need data(output) to get downloaded in excel format in my PC from an internal table;;in any drive i.e. C: or D: .When executing in backround it prompt to user with which location excel file to be saved and the name of file.How to download in background in excel format?
Edited by: PRASHANT BHATNAGAR on Aug 26, 2008 6:24 AMHi
Download a report to excel with format (border, color cell, etc)
Try this program...it may help you to change the font ..etc.
Code:
REPORT ZSIRI NO STANDARD PAGE HEADING.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_MAPL TYPE OLE2_OBJECT, " list of workbooks
H_MAP TYPE OLE2_OBJECT, " workbook
H_ZL TYPE OLE2_OBJECT, " cell
H_F TYPE OLE2_OBJECT. " font
TABLES: SPFLI.
DATA H TYPE I.
table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
*& Event START-OF-SELECTION
START-OF-SELECTION.
read flights
SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
display header
ULINE (61).
WRITE: / SY-VLINE NO-GAP,
(3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
ULINE /(61).
display flights
LOOP AT IT_SPFLI.
WRITE: / SY-VLINE NO-GAP,
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
ENDLOOP.
ULINE /(61).
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-007
EXCEPTIONS
OTHERS = 1.
start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-008
EXCEPTIONS
OTHERS = 1.
get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP.
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - start
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
PERFORM ERR_HDL.
tell user what is going on
SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - end
disconnect from Excel
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:\SKV.XLS'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL USING I J BOLD VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
Regards
Murali Papana -
Hi Gurus:
One of the business requirement is to EXTRACT data from relevant tables that the R/3 TCode "MRKO" provides in a report format in to BI. I don't tknow if there is any std. SAP extractor that would provide me the details. We need this data to determine the payment DATE based on "Payment Terms" using a logic, then summarize the data at each Vendor level and pass this information to the BI Cube. We need this information for a Cash Flow Forecasting project.
I am not familiar with the Tcode MRKO or the program. I would appreciate it if anyone can shed some light here. I basically need a Total Due amount for a month period, Vendor, The date on which the payment has to be made in future based on the Payment terms and Company code. I don't know the tables involved, but the TCODE provides a "Total" per Vendor and thats what I would like to capture and pass to BI. How can I achieve this?
Appreciate the name of the STD extractor if one exists or the table(s), and if any logic is necessary.....?
Thanks a lot in advance.....!
PBSWHI,
I am not aware of any standard extractor for the report that you get from Tcode MRKO, But I can suggest you in a very customized way to extract the data into BW.
When you run the transaction "MRKO", please check the program that is running in the background for that report to run and get the data output. You could easily find from the lower side menu bar.
Once if you get to know the program, create a structure and create a datasource assigned to that structure, where the datasource uses funcion module as its extraction method. In SAP you can easily convert a program into a function module and let the extractor fill your datasource for extraction.
- Another way of doing it, is to find out the tables that it is retrieving from the report MRKO and create a structure with those fields filled up using a function module. And then use that structure and function module for your new datasource to extract. -
How to show data output in SSRS
Below is my simply query. I need to use Matrix SSRS format. I will put "Region" in "row" column, Header will use "Customer_Requested_Date" field, and will use "Amount" in the data session.
The data output in the "Header" field will show January.....until December (current month is December). In the Amount field under "December" (current month), I need to compute the formula like "Customer_Request_Month"
< = Current Month". (I do not have the field name called Current Month, need to get a Date/Time function to display Current Month).
How I can come up the data output under December Header field to show the current Amount in that section?
November, 2014
December,2014
Region
Amount
CRD Month < = Current Month
Select
Customer_Request _Date,
Customer_request_Month,
Transaction_Type,
Region,
Amount
From Table
Thanks,
Josephine
Josey TangHi Josey,
According to your descritption, you want to show the current month in your tablix. Right?
In Reporting Services, we can use the Now() and datepart() function to get the current month. Please use the expression below:
=Datepart("m",Now())
In this scenario, since you want to show the amount of current month within the column group, you need to create another dataset which always show the data of current month. Then you can use lookup() function to get the amount value from the current dataset
based on the Region. Please follow the steps below:
Create a same dataset(DataSet2) using your query. Add a filter on this dataset. Make Fields!Customer_request_Month.Value
=
Datepart("m",Now())
Then add a column inside of column group, using the expression below:
=lookup(Fields!Region.Value,Fields!Region.Value,Fields!Amount.Value,"DataSet2")
The design and result look like below:
Reference:
Expression Examples (Report Builder and SSRS)
Lookup Function (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
XML data output in a custom grid table
Hi!
I was wondering if it is possible to display xml data output in a custom-made grid table? Important is the ability to
arrange the fields on the grid layout (not a fixed layout with columns and rows).
I am using the latest JDeveloper release.
Thanks!See [url http://docs.oracle.com/cd/E14072_01/server.112/e10592/functions251.htm#CIHGGHFB]XMLTABLE
For example:
-- INSERT INTO <your table name>
WITH x AS
(SELECT XMLTYPE('<?xml version="1.0"?>
<ROWSET>
<ROW>
<EMPNO>7782</EMPNO>
<ENAME>CLARK</ENAME>
<JOB>MANAGER</JOB>
<MGR>7839</MGR>
<HIREDATE>09-JUN-81</HIREDATE>
<SAL>2450</SAL>
<DEPTNO>10</DEPTNO>
</ROW>
<ROW>
<EMPNO>7839</EMPNO>
<ENAME>KING</ENAME>
<JOB>PRESIDENT</JOB>
<HIREDATE>17-NOV-81</HIREDATE>
<SAL>5000</SAL>
<DEPTNO>10</DEPTNO>
</ROW>
<ROW>
<EMPNO>7934</EMPNO>
<ENAME>MILLER</ENAME>
<JOB>CLERK</JOB>
<MGR>7782</MGR>
<HIREDATE>23-JAN-82</HIREDATE>
<SAL>1300</SAL>
<DEPTNO>10</DEPTNO>
</ROW>
</ROWSET>') myxml
FROM DUAL)
SELECT *
FROM x
, XMLTABLE('/ROWSET/ROW'
PASSING x.myxml
COLUMNS empno, ename, job, mgr, hiredate, sal, deptno); -
How do I create individual xml files from the parsed data output of a xml file?
I have written a program (DOM Parser) that parses data from a XMl File. I would like to create an individual file with the corresponding name for each set of data parsed from the xml document. If the parsed output is Single, Double, Triple, I would like to create an individual xml file (Single.xml, Double.xml, Triple.xml)with those corresponding names. How do I create the xml files and give each file the name of my parsed data output? Thanks in advance for your help.
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class MyDomParser {
public static void main(String[] args) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse("ENtemplate.xml");
doc.normalize();
NodeList rootNodes = doc.getElementsByTagName("templates");
Node rootNode = rootNodes.item(0);
Element rootElement = (Element) rootNode;
NodeList templateList = rootElement.getElementsByTagName("template");
for(int i=0; i < templateList.getLength(); i++) {
Node theTemplate = templateList.item(i);
Element templateElement = (Element) theTemplate;
System.out.println("Template" + ": " +templateElement.getAttribute("name")+ ".xml");
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();Ive posted the new code but now I'm getting a FileAlreadyExistException error. How do I handle this exception error correctly in my code?
import java.io.IOException;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.Paths;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class MyDomParser {
public static void main(String[] args) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse("ENtemplate.xml");
doc.normalize();
NodeList rootNodes = doc.getElementsByTagName("templates");
Node rootNode = rootNodes.item(0);
Element rootElement = (Element) rootNode;
NodeList templateList = rootElement.getElementsByTagName("template");
for(int i=0; i < templateList.getLength(); i++) {
Node theTemplate = templateList.item(i);
Element templateElement = (Element) theTemplate;
System.out.println(templateElement.getAttribute("name")+ ".xml");
for(int i=0; i < templateList.getLength(); i++) {
Node theTemplate = templateList.item(i);
Element templateElement = (Element) theTemplate;
String fileName = templateElement.getAttribute("name") + ".xml";
Files.createFile(Paths.get(fileName));
System.out.println("File" + ":" + fileName + ".xml created");
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace(); -
Can you please provide an example of test case using "Standard Data Output Cascade Mode"?
Hi,
I have tried creating a test to check the "Standard Data Output Cascade Mode". In Vivado 15.1, Ultrascale, it is working when I have data_width=1. However, if I modify the data_width to greater than 1, then I am not seeing the proper value for .CASCADE_ORDER_B. Is this expected?
The RTL is top.v. The addr_width=16, data_width=4. The synthesized vm netlist, test_syn.vm. It contains 8 BRAMS but the .CASCADE_ORDER_B parameter setting in the vm netlist is:
.CASCADE_ORDER_B("FIRST"),
.CASCADE_ORDER_B("MIDDLE"),
.CASCADE_ORDER_B("MIDDLE"),
.CASCADE_ORDER_B("MIDDLE"),
.CASCADE_ORDER_B("MIDDLE"),
.CASCADE_ORDER_B("MIDDLE"),
.CASCADE_ORDER_B("MIDDLE"),
.CASCADE_ORDER_B("LAST"),Hi
The parameter "CASCADE_ORDER_B" specifies the order of the cascaded block RAMs from the bottom to the top of the chain
for port B.
So the attribute value FIRST represents the bottom BRAM with respect to cascading. You can cross these attributes by opening synthesized design and observing the property of each BRAM.
Thanks,
Vinay -
User Defined Field that gives the date output of the last price update.
We would like to create a User Defined Field (UDF) with a Formatted Search (FMS) on the Item Master form that gives the date output of the last price update specifically the wholesale price.
Last Price Update
Pricelist 2 = Wholesale
Is this feasible?
If it is feasible what is the recommended approach?
Current working UDF on Item Master.
/* Date output is based on all the latest updates on the Item Master.*/
select max(updatedate)
from aitm
where itemcode = $[oitm.itemcode]
Resources that were helpful.
1.(Note:1165947 - Tracking Item Price Changes.)
2. Case 4-I6: Query on price updates. Mastering SQL Queries for SAP Business One By: Gordon DuThank you Gordon,
We are looking for the date output of the 'Last Price Update' based on 'Pricelist 2 = Wholesale' which is the challenge.
These 2 are the parameters for the date output, I should have mentioned that in my original message.
Last Price Update
Pricelist 2 = Wholesale
Per reading a bunch of other similar Forum Questions it looked like it is might not be possible to do. With there being no date on the AIT1 table and AITM.Updatedate is based on any and all updates not just last 'Last Price Update' and not sure how to use the loginstanc.
Thanks,
Vern -
Hi, I would like to know how I can automate the output of data collected in CSV format? Manual intervention i.e. output and subsequent Server upload is not efficient. I would like to have the data output, such as a CSV file, as an email attachment which could be "pulled" by my server and integrated into a "CRM" and such like for better data manipulation. Does anyone have any suggestions?
I am sorry but we don't have this facility within Formscentral at this time.
Andrew -
Reverse data output from Agilent 3458A
I'm taking 500 sub-samples of a 500mS ramp waveform from a function generator with the attached vi, and the data output is reversed in time. That is, the data as displayed on the waveform chart shows the TRAILING edge first - a time-mirror image of the actual waveform captured. I thought this had to do with LIFO/FIFO, so I forced FIFO, but it doesn't help. What must I do to get the proper time-sequence data from the DMM?
Can't seem to attach my vi , but it's identical to the Labview sample Agilent 3458 Acquire Multiple Measurement.vi, with the addition of a VISA Write MEM FIFO.Ok, the data just comes out as an array. Well if you know that the data is backwards, just use Reverse 1D Array (as I already stated) to flip it back.
I remember working with that DMM before. I never found a way to get the data to come out like a FIFO. That's just the way the instrument works. Reverse the array and be done with it.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
SQL pasted below is expected to return dates output in format shown,
with weekday begining 'MONDAY'. The SQL can be ran by creating
a dummy table 'CAL_MONTHS' with one number column with around 200 null rows.
The SQL I have written works fine up to the month and week level but it gets
messed up when trying to print the dates/days for the particular week.
I would greatly appreciate any help.
OUTPUT format I am trying to get:
Month: JAN-2007
================
Week NO. 1
Week-Day Date Day
Monday 1/1 01-JAN-07 01
Tuesday 2/1 02-JAN-07 02
Wednesday 3/1 03-JAN-07 03
Thursday 4/1 04-JAN-07 04
Friday 5/1 05-JAN-07 05
Saturday 6/1 06-JAN-07 06
Sunday 7/1 07-JAN-07 07
Week NO. 2
Week-Day Date Day
Monday 8/1 08-JAN-07 08
Tuesday 9/1 09-JAN-07 09
Wednesday 10/1 10-JAN-07 10
Thursday 11/1 11-JAN-07 11
Friday 12/1 12-JAN-07 12
Saturday 13/1 13-JAN-07 13
Sunday 14/1 14-JAN-07 14 AND SO ON........
Week NO. 3
Week-Day Date Day
Week NO. 4
Week-Day Date Day
Week NO. 5
Week-Day Date Day
Following is the SQL
set serveroutput on
begin
for xx in(
SELECT months v_months, to_date('01-'||months,'DD-MON-YYYY') v_dt
FROM ( SELECT distinct TO_CHAR(days,'MON-YYYY') months
FROM (SELECT to_date('01/01/2007','dd/mm/yyyy') + (ROWNUM-1) days
FROM cal_months
WHERE ROWNUM <= to_number(to_date('01/03/2007','dd/mm/yyyy') - to_date('01/01/2007','dd/mm/yyyy')) +1)
ORDER BY to_date('01-'||months,'DD-MON-YYYY')) loop
dbms_output.put_line(chr(10));
dbms_output.put_line('Month: '||xx.v_months);
dbms_output.put_line(' ================ ');
for xy in(
SELECT distinct
TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'IW') -
TO_CHAR(TRUNC(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'MM'),'IW')+1 week_no
FROM cal_months
WHERE ROWNUM <= TO_CHAR(LAST_DAY(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY')),'DD')) loop
--dbms_output.put_line(chr(10));
dbms_output.put_line(' Week NO. '||xy.week_no);
dbms_output.put_line(' ---------- ');
dbms_output.put_line(' Week-Day Date Day');
dbms_output.put_line(' ------------------------------------------ ');
for zz in(
SELECT
TO_CHAR((TO_DATE('01-'||xx.v_months,'DD-MON-YYYY') -
DECODE(TO_CHAR(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY'),'Dy'),
TO_CHAR(TO_DATE('01-JAN-2007','DD-MON-YYYY'),'Dy'), 0,
TO_CHAR(TO_DATE('02-JAN-2007','DD-MON-YYYY'),'Dy'), 1,
TO_CHAR(TO_DATE('03-JAN-2007','DD-MON-YYYY'),'Dy'), 2,
TO_CHAR(TO_DATE('04-JAN-2007','DD-MON-YYYY'),'Dy'), 3,
TO_CHAR(TO_DATE('05-JAN-2007','DD-MON-YYYY'),'Dy'), 4,
TO_CHAR(TO_DATE('06-JAN-2007','DD-MON-YYYY'),'Dy'),5,
TO_CHAR(TO_DATE('07-JAN-2007','DD-MON-YYYY'),'Dy'), 6)) + (ROWNUM-1) ,'FMDay dd/mm') datee,
'' day, to_date('') the_date
FROM cal_months
WHERE ROWNUM <= DECODE(TO_CHAR(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY'),'Dy'),
TO_CHAR(TO_DATE('01-JAN-2007','DD-MON-YYYY'),'Dy'), 0,
TO_CHAR(TO_DATE('02-JAN-2007','DD-MON-YYYY'),'Dy'), 1,
TO_CHAR(TO_DATE('03-JAN-2007','DD-MON-YYYY'),'Dy'), 2,
TO_CHAR(TO_DATE('04-JAN-2007','DD-MON-YYYY'),'Dy'), 3,
TO_CHAR(TO_DATE('05-JAN-2007','DD-MON-YYYY'),'Dy'), 4,
TO_CHAR(TO_DATE('06-JAN-2007','DD-MON-YYYY'),'Dy'),5,
TO_CHAR(TO_DATE('07-JAN-2007','DD-MON-YYYY'),'Dy'),6)
UNION ALL
SELECT
TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY'),'FMDay dd/mm') datee,
TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY'),'dd') day,
TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') the_date
FROM cal_months
WHERE
ROWNUM <= TO_CHAR(LAST_DAY(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY')),'DD')
and
TO_CHAR(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY'),'MON-YYYY') = xx.v_months
and
TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'IW') -
TO_CHAR(TRUNC(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'MM'),'IW')+1 = xy.week_no
) loop
dbms_output.put_line(zz.datee||' '||zz.the_date||' '||zz.day); end loop;
end loop;
end loop;
end;Try that:
With weeks of month
declare
vyear number:=2007;
vmes number := 9;
vdays number;
week_day number:=0;
num_day number:=0;
fx date;
begin
vdays := to_char(last_day(to_date(vmes, 'mm')), 'dd');
dbms_output.put_line(to_char(to_date(vmes, 'mm'), 'Mon') || '-' || vyear);
for j in 1..vdays loop
fx := to_date(lpad(j,2,0) || lpad(vmes,2,0) || vyear, 'ddmmyyyy');
if to_char(fx, 'w')!= week_day then
week_day := to_char(fx, 'w');
dbms_output.put_line('Week No.'|| week_day);
dbms_output.put_line('-----------');
dbms_output.put_line('Week_Day Date Day');
dbms_output.put_line('---------------------------');
end if;
num_day := to_char(fx, 'd');
dbms_output.put_line(
to_char(fx, 'Day') || chr(9) ||
to_char(fx, 'dd/mm') || chr(9) ||
to_char(fx, 'dd-Mon-yy') || chr(9) ||
to_char(fx, 'dd')
end loop;
end;
Sep-2007
Week No.1
Week_Day Date Day
Saturday 01/09 01-Sep-07 01
Sunday 02/09 02-Sep-07 02
Monday 03/09 03-Sep-07 03
Tuesday 04/09 04-Sep-07 04
Wednesday 05/09 05-Sep-07 05
Thursday 06/09 06-Sep-07 06
Friday 07/09 07-Sep-07 07
Week No.2
Week_Day Date Day
Saturday 08/09 08-Sep-07 08
Sunday 09/09 09-Sep-07 09
Monday 10/09 10-Sep-07 10
Tuesday 11/09 11-Sep-07 11
Wednesday 12/09 12-Sep-07 12
Thursday 13/09 13-Sep-07 13
Friday 14/09 14-Sep-07 14
Week No.3
Week_Day Date Day
Saturday 15/09 15-Sep-07 15
Sunday 16/09 16-Sep-07 16
Monday 17/09 17-Sep-07 17
Tuesday 18/09 18-Sep-07 18
Wednesday 19/09 19-Sep-07 19
Thursday 20/09 20-Sep-07 20
Friday 21/09 21-Sep-07 21
Week No.4
Week_Day Date Day
Saturday 22/09 22-Sep-07 22
Sunday 23/09 23-Sep-07 23
Monday 24/09 24-Sep-07 24
Tuesday 25/09 25-Sep-07 25
Wednesday 26/09 26-Sep-07 26
Thursday 27/09 27-Sep-07 27
Friday 28/09 28-Sep-07 28
Week No.5
Week_Day Date Day
Saturday 29/09 29-Sep-07 29
Sunday 30/09 30-Sep-07 30
With weeks of years
declare
vyear number:=2007;
vmes number := 9;
vdays number;
week_day number:=0;
num_day number:=0;
fx date;
begin
vdays := to_char(last_day(to_date(vmes, 'mm')), 'dd');
dbms_output.put_line(to_char(to_date(vmes, 'mm'), 'Mon') || '-' || vyear);
for j in 1..vdays loop
fx := to_date(lpad(j,2,0) || lpad(vmes,2,0) || vyear, 'ddmmyyyy');
if to_char(fx, 'ww')!= week_day then
week_day := to_char(fx, 'ww');
dbms_output.put_line('Week No.'|| week_day);
dbms_output.put_line('-----------');
dbms_output.put_line('Week_Day Date Day');
dbms_output.put_line('---------------------------');
end if;
num_day := to_char(fx, 'd');
dbms_output.put_line(
to_char(fx, 'Day') || chr(9) ||
to_char(fx, 'dd/mm') || chr(9) ||
to_char(fx, 'dd-Mon-yy') || chr(9) ||
to_char(fx, 'dd')
end loop;
end;
Sep-2007
Week No.35
Week_Day Date Day
Saturday 01/09 01-Sep-07 01
Sunday 02/09 02-Sep-07 02
Week No.36
Week_Day Date Day
Monday 03/09 03-Sep-07 03
Tuesday 04/09 04-Sep-07 04
Wednesday 05/09 05-Sep-07 05
Thursday 06/09 06-Sep-07 06
Friday 07/09 07-Sep-07 07
Saturday 08/09 08-Sep-07 08
Sunday 09/09 09-Sep-07 09
Week No.37
Week_Day Date Day
Monday 10/09 10-Sep-07 10
Tuesday 11/09 11-Sep-07 11
Wednesday 12/09 12-Sep-07 12
Thursday 13/09 13-Sep-07 13
Friday 14/09 14-Sep-07 14
Saturday 15/09 15-Sep-07 15
Sunday 16/09 16-Sep-07 16
Week No.38
Week_Day Date Day
Monday 17/09 17-Sep-07 17
Tuesday 18/09 18-Sep-07 18
Wednesday 19/09 19-Sep-07 19
Thursday 20/09 20-Sep-07 20
Friday 21/09 21-Sep-07 21
Saturday 22/09 22-Sep-07 22
Sunday 23/09 23-Sep-07 23
Week No.39
Week_Day Date Day
Monday 24/09 24-Sep-07 24
Tuesday 25/09 25-Sep-07 25
Wednesday 26/09 26-Sep-07 26
Thursday 27/09 27-Sep-07 27
Friday 28/09 28-Sep-07 28
Saturday 29/09 29-Sep-07 29
Sunday 30/09 30-Sep-07 30 -
Date output comes out DDMMYYYY instead of MMDDYYYY? Hint on fixing this?
Hi,
1. If my date output comes out as DDMMYYYY, where in my infoojbect shipdate, can I modify it to come out as MMDDYYYY?
2. While on this, how do I add a new Unit in my flat file transaction data to 0UNIT?
3. Also, the Price column comes out as 25,00 instead of 25.00 i.e. the decimals are coming out as commas, any help?
Thanks
Edited by: AmandaBaah on Apr 23, 2010 9:47 PMHi AmandaBaah,
Not sure about this, but this is what I would try:
Regarding 1 and 3:
Try to check on SU01D for your Username, check de Default tab.
Date format
Decimal Notation
Regarding: 2
Normally 0UNIT are filled up via Source system. But, you can try to use transaction CUNI
(SPRO -> SAP NetWeaver -> General Settings -> Check Units of Measurement)
Hope it helps,
Marcelo -
No data output field in DAQ Assistant
I am currently trying to read temperature from my NI WSN 3202. I have a thermistor connected to AI0 and AIGND. I am following a tutorial to convert from volts to degrees F and everything has been working so far.
Once I reach the step for DAQ that is when I have issues. I've created a simulated device (following another tutorial). When I configure everything for DAQ, there is no data field so that I can wire it to my indicator and then to the formula block. Can anyone assist me with this problem?
Pictures have been included. (The picture that has the data field is what I'm trying to get to)
Thank you in advance!
Attachments:
1.PNG 111 KB
2.PNG 94 KB
3.PNG 326 KBI would do as the error message tells you, reinstall DAQmx.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Maybe you are looking for
-
Error: When deploying the DC after adding the web services
Hi Experts, I was able to add the Webservice sucessfully. I execute the Webservice using the following code Request_ServiceHttpGet_getMaterialInfo Catalogue_Req = new Request_ServiceHttpGet_getMaterialInfo(); wdContext.nodeRequest_ServiceHttpGet_get
-
i am having problems with my WRT54GS. I have a Telephone modem, which I connect to the router, and then I have a wired connection between the router and my desktop. The wireless connections are working just fine. but i tried connecting to my xnox 3
-
Workstation Manager Service - High Memory Consumption
Anytime I leave my work PC running for 2-3 days without restarting it, the Workstation Manager Service gradually starts to consume more and more memory. It seems like every day past when I restart this work PC, the Window's Task Manager will show tha
-
What is the table name for getting Last Receipt & issue date of material?
Hi Friends, What is the table name for getting Last Receipt & issue date of material? *Case 1:* Here, I am running report in May 2008. But, if there is no goods receipt for the respective material since last 13th March 2007. Then in this case Last g
-
Halftones in layout print out wrong
When I place a bitmap halftone in the layout it looks fine, but prints out with extra patterns. It didn't do this is PageMaker. How can I preserve the halftone for printing?