User Profile
Collapse
-
I finally got around this by not trying to be too clever and using the multi-select parameters instead of coding my own method for it. -
-
Order of precedence and Logical operators
So here is my dilemma.
This code that I have written produces three options
The first is a VB calender start date and end date for filtering.
The second is a dynamically filled drop down which selects the department or defaults to all departments.
The second is a dynamically filled drop down which defaults to add 'Cells' which is just a two letter code.
To create the default the <All... -
select unique and return related table
This Code selects a unique entry of the Manufacturing Order.
...Code:DECLARE @suffix NVARCHAR(8) DECLARE @DateStart NVARCHAR(12) DECLARE @DateEnd NVARCHAR(12) SET @suffix = '/M' SET @DateStart = '01/05/2013' SET @DateEnd = '08/05/2013' SELECT a.* from ManufacturingOrders a INNER JOIN (SELECT DISTINCT ManufacturingOrderId FROM ManufacturingOrders) AS b ON a.ManufacturingOrderId
-
If im not allowed yo dub it primitive I find vba ... Quaint.
Ok ill look into openArgs.Leave a comment:
-
Ok ill accept that access is that primitive.
got an example i can mash?Leave a comment:
-
Related tables and opening forms
I have 3 tables related as follows
Requests,-<, Job -< Tool
One request has many Jobs and each Job has many tools.
I want to open Request, enter data then hit a button which closes that window
... and opens the Job window on the related record.
Hit a button which closes that window
...and opens a Tool form
Which allows data entry
and gives the... -
Youre right. Simply adding a space at the end of each line in the text file allowed the file to process properly.
Thank you.Leave a comment:
-
Ok to find exactly what line number it faults in i removed the try catch and allowed it to exception.
It faults at line 43 with reader = SQLcmd.ExecuteR eader(); with the error "Incorrect syntax near the keyword like"
SQLcmd at this point is select ItemDescription from PurchaseOrderIt ems where ItemDescription like 'z%'
Hope this helpsLeave a comment:
-
... The catch at line number 63...
The string physically looks like the text document version.
If I copy paste that into SQL management and execute it it works perfectly.
For instance, if I change the dbtext.txt file to say 'select * from inventory' it works fine. So the code is concrete, but I think the syntax error being detected by the SQLcommand is the apostrophe at the beggining of '%z'.Leave a comment:
-
It's being caught by the try catch exception. It doesn't report a line number but it should be the catch at 63 thats preventing an exception. The returned error string is "inccorect syntax near the keyword 'like'".
This program will happily process code which doesnt have reserved characters in it so I know the code works fine and if I manually create a string with the code in it it will process. It seems only an issue if...Leave a comment:
-
C#+SQL processing reserved characters
I've written a program that loads in a text SQL file of commands Processes it and displays the result.
To test it I wrote a simple top 10 query which worked perfectly. Then I thought I'd like to test other scripts so in my text document I created:
select ItemDescription from PurchaseOrderIt ems
where ItemDescription like 'z%'
At which point my code balked at the like and whined about a syntax error... -
-
Where do you suggest?
Visual Basic?
VBS
SQL
Microsoft SQL Report services
Visual studioLeave a comment:
-
Ho to hide a row(s) using a radio button?
I need to create a completely different form layout depending on the setting of a boolean switch (Radio button) on a form.
I have added a boolean radio button to the layout called AltForm and I was going to use the visibility property to hide or show the rows as I would do in vidual basic. Only I can't seem to figure out how to change the property. The parameter textboxt10.visi ble does nothing except cause a syntax error.
I... -
The alternative code using the technique as explained above by ck9663 for comparison.
...Code:DECLARE @Classification bigint SET @Classification = (SELECT Classification FROM Classifications WHERE Classifications.ClassificationId = 'STOCKITEM') select * from ( select Dtbl.SalesYear Dtbl.SalesMonth, Dtbl.ProductId, row_number() over (partition by SalesYear,SalesMonth
Leave a comment:
-
This is the final version I added to the code. It's not the same method as the suggestion above but I managed to get that way working after I got the report to function properly. If I can find the method detailed here I will post it for comparison - Microblitz
...Code:DECLARE @Classification bigint DECLARE @StartDate smalldatetime DECLARE @EndDate smalldatetime DECLARE @MonthEndDate smalldatetime DECLARE @TempDate
Leave a comment:
-
Yes that makes a lot more sense as soon as you mentioned the "AS" keyword.
The "z" routeine I can leave as is, but the 'q' query needs to specify the particulatr brand of product from a related search.
This is the relationship that needs to be parsed
...Code:FROM ManufacturingOrders INNER JOIN Products ON ManufacturingOrders.Product = Products.Product INNER JOIN Classifications
Leave a comment:
-
Well I do now, though my guess work was reasonably accurate. It provides a seconed layer of filtering to the original query.
I guess the two levels of sub query is the (sub query here) and the final line in the original example.
"where rank <= 4 "Leave a comment:
No activity results to display
Show More
Leave a comment: