Database administration tool for Windows OS family.
Questions tagged [winsql]
24 questions
6
votes
1 answer
Joining two tables, multiple rows into a single row different columns
I have two tables.
USER
USER_ID | USER_NAME
--------------------
659 | John
660 | Andrew
661 | Bianca
--------------------
USER_ADDRESS
USER_ID |TYPE | ADDRESS
------------------------------
659 | HOME | New York
659 …

swirl84
- 85
- 1
- 5
2
votes
1 answer
SQL Multiple inner joins with max() for latest recorded entry
Attempting to build SQL with INNER JOIN's. The INNER JOIN's work ok, now I need to add the MAX() function for limiting the rows to just most recent. Added this INNER JOIN client_diagnosis_record ON SELECT cr.PATID, cr.date_of_diagnosis,…

manager_matt
- 395
- 4
- 19
1
vote
0 answers
Fuzzy Matches in WinSQL from List
Looking to enhance my code in R using an RODBC connection to WinSQL to retrieve fuzzy matches.
The query to retrieve exact matches works perfectly, i.e. 'John Doe' and 'Jane Doe' are successfully matched from the uploaded list to the main table.…

QueensMMAgrad
- 19
- 4
1
vote
2 answers
IBM i (iSeries) Power 7 - WinSQL
I am having an sudden issue, I have a IBM Power 7 iseries AS/400 server, I just store my database here, the development team works with Genexus and from yesterday we are unable to create tables (for example) in the server not even running the…

Enrique Estrop
- 11
- 1
1
vote
1 answer
Informix error when calling a procedure
Recently I had an informix database server cloned. I created a new stored procedure called sp_foo.
When I run the below SQL to execute a procedure
EXECUTE PROCEDURE sp_foo();
I get the below error when I call a stored procedure.
Error: The system…

nJoshi
- 376
- 1
- 5
- 16
1
vote
0 answers
winsql - Divide with the Rollup Value
I'm running the following Query:
select isnull(right(araccltid,4),'Tot') as ProdCode, count(aracid) as NumofAccounts
from araccount
where right(araccltid,4) between 5109 and 5112
group by right(araccltid,4) with rollup
using winSQL and it…

Cam S
- 11
- 1
0
votes
1 answer
Crystal Reports: Too many arguments given to this function
I am new to crystal and still learning, I have the following formula field in crystal
IF ISNULL({command.Step1}) AND ISNULL({@step1 15 day check}) THEN ToText({command.step1Due}, 'MM/dd/yyyy') ELSE ToText({command.step1}, 'MM/dd/yyyy')
I keep…

pihard314
- 1
- 1
0
votes
1 answer
Crystal Reports:IF/THEN/ELSE with null values and multiple conditions
I am new to crystal reports and am writing a formula for crystal so I can get a check for when certain trainings are due and every training has a different due date. For example if someone was hired 9/1/2022, they would have 15 days for report…

pihard314
- 1
- 1
0
votes
0 answers
Conversion error when adding additional clauses
need your expertise on the "Conversion failed when converting date and/or time from character string". Much written about it and tried looking though it and understanding it to the extend I could but it did not solve the issue.
My code includes a…
0
votes
0 answers
WinSQL adding numbers to a date
I'm trying to query between two dates using WinSQL where I add a number of days to a field. I can't find the function to do it. I think it should be dateadd but that function does not seem to work in WinSQL.
select * from table
where a.date1…

Dtunn
- 1
0
votes
2 answers
Purchase Price base on Latest Trans Date of each item from a same Item Purchase Table
I have a query which I want to list all latest transaction date for the purchase price for each stock item.
I used aggregate MAX() to list all latest transaction for each item without including the price and it works perfect. But when I included the…

Vincent Lee
- 1
- 1
0
votes
1 answer
Method to batch-run UPDATE statements via SQL on an Access Database
I have an Access Database in which I need to update about 1500 out of 79000 entries in a given table. I've been presented with an Excel spreadsheet of the key ID's for which I need to modify a particular column.
It's basically re-assigning a…

OzPass
- 11
0
votes
1 answer
how to write on error rollback in IBM DB2 WinSQL sql script
Example :
Let's say, I have 3 INSERT statements. I am using WinSQL to execute the following script:
SAVEPOINT A;
INSERT_STATEMENT 1;
INSERT_STATEMENT 2;
INSERT_STATEMENT 3;
Now, INSERT_STATEMENT 1 is successful.
INSERT_STATEMENT 2 is…

Sameer Ranalkar
- 1
- 1
0
votes
1 answer
WinSQL ORDER BY alphanumeric DB2 syntax
I have the following set of data:
33
5A
5B
12
34A
2
34B
2B
11
10
12A
When I run the following SQL in WinSQL:
with input (f) as (
values ('33'), ('5A'), ('5B'),('12'), ('34A'),('2'), ('34B'), ('2B'), ('11'), ('10'), ('12A')
)
SELECT f
FROM…

Lily
- 9
- 6
0
votes
1 answer
I'm using WinSQL Lite and trying to use DATEPART but am not sure how
I need to group this SQL string by the hour for one USER_ID but I am unsure how to use the DATEPART function I've been reading about.
Basically, I want to get the performance data for every hour of this user from the time they start work till the…

Chris Hall
- 11
- 2