mrdudebro1
mrdudebro1
CC#
Created by mrdudebro1 on 10/26/2024 in #help
invalid column SQL
select inv_mast.item_id, sum(qty_on_hand) qty_on_hand, max(invoice_date) latest_invoice_date from inv_mast
join inv_loc on inv_loc.inv_mast_uid = inv_mast.inv_mast_uid
full join p21_sales_history_report_view on inv_mast.inv_mast_uid = p21_sales_history_report_view.inv_mast_uid
where qty_on_hand > 0 and location_id <> 40 and latest_invoice_date <= DATEADD(YEAR,-2,getdate())
group by inv_mast.item_id
select inv_mast.item_id, sum(qty_on_hand) qty_on_hand, max(invoice_date) latest_invoice_date from inv_mast
join inv_loc on inv_loc.inv_mast_uid = inv_mast.inv_mast_uid
full join p21_sales_history_report_view on inv_mast.inv_mast_uid = p21_sales_history_report_view.inv_mast_uid
where qty_on_hand > 0 and location_id <> 40 and latest_invoice_date <= DATEADD(YEAR,-2,getdate())
group by inv_mast.item_id
why is latest_invoice_date considered an invalid column here sql error Invalid column name 'latest_invoice_date'.
1 replies
CC#
Created by mrdudebro1 on 5/3/2024 in #help
SSRS add repeating title ABOVE column groups
No description
2 replies
CC#
Created by mrdudebro1 on 3/14/2024 in #help
how to use 'like' in SSRS
HI ALL. i have a query where i'm trying to use 'like' with a parameter and it doens't seem to be working.
select po_hdr.po_no, po_hdr.order_date, po_hdr.created_by, expdite_date, next_action, vendor_name, supplier_so, contact_id,
contacts.email_address, contacts.direct_phone, contacts.home_phone, contacts.phone_ext, ackn_date
from po_hdr_ud
join po_hdr on po_hdr.po_no = po_hdr_ud.po_no
join vendor on vendor.vendor_id = po_hdr.vendor_id
left join contacts on po_hdr.contact_id = contacts.id
WHERE (po_hdr.po_no = @RG_PO_NO or @RG_PO_NO is null) AND (po_hdr_ud.supplier_so LIKE @Supplier_SO or @Supplier_SO = '') AND (vendor_name like '*'+@
Supplier_Name+'*' or @Supplier_Name = '') and (po_hdr.created_by LIKE @RG_Buyer or @RG_Buyer = '')
select po_hdr.po_no, po_hdr.order_date, po_hdr.created_by, expdite_date, next_action, vendor_name, supplier_so, contact_id,
contacts.email_address, contacts.direct_phone, contacts.home_phone, contacts.phone_ext, ackn_date
from po_hdr_ud
join po_hdr on po_hdr.po_no = po_hdr_ud.po_no
join vendor on vendor.vendor_id = po_hdr.vendor_id
left join contacts on po_hdr.contact_id = contacts.id
WHERE (po_hdr.po_no = @RG_PO_NO or @RG_PO_NO is null) AND (po_hdr_ud.supplier_so LIKE @Supplier_SO or @Supplier_SO = '') AND (vendor_name like '*'+@
Supplier_Name+'*' or @Supplier_Name = '') and (po_hdr.created_by LIKE @RG_Buyer or @RG_Buyer = '')
when i type in a value into the supplier_name parameter that SHOULD return something .it returns nothing
4 replies
CC#
Created by mrdudebro1 on 2/23/2024 in #help
psexec to install tools remotely
I'm trying to use the command psexec \\COMPUTER -c file.msi to copy and execute a file on a remote computer but the command fails with PsExec could not start file.msi on COMPUTER: The system cannot find the file specified. I'm running the command prompt in the directory of my local machine that has the msi file
1 replies
CC#
Created by mrdudebro1 on 12/5/2023 in #help
Regex Group Contains
hey simple easy question, but are there ways to access individual capture groups in a regex match? I want to say
if(regex.Group(2).contains("401") {
//do some stuff with
}
if(regex.Group(2).contains("401") {
//do some stuff with
}
28 replies
CC#
Created by mrdudebro1 on 12/4/2023 in #help
Regex conditional
Hi all,
(?(?=.[P]*)((ADIP)(\d{0,3})[P]\d{3}\.(\d{1,2}))|((ADIP)(\d{0,10})\.(\d{1,2})))
(?(?=.[P]*)((ADIP)(\d{0,3})[P]\d{3}\.(\d{1,2}))|((ADIP)(\d{0,10})\.(\d{1,2})))
I'm trying to use a conditional to find if there is a P in my string but for some reason the else condition of this doesn't get picked up on. For example, This matches: ADIPP350.16 but this doesn't (and should): ADIP350.16 i can only presume there is some confusion with the P in the ADIP literal match
7 replies
CC#
Created by mrdudebro1 on 12/1/2023 in #help
Branching if statements
so. i have some data in a database that needs to be assigned data based on an id. I have a database full of items, and each item has attributes. lets say they are tools. the id could be HAMMERSTEEL.10 or HAMMERIRON12.12. the first one means it's a 10" long steel hammer with a standard head size and the second one is a 12" long iron hammer with a 12mm head or something of that nature. i have at least four different base types HAMMER AXE SCREWDRIVER. I need to assign attributes in a new table based on the item id's. what i already have is a database filled with what i want the data to look like. i'll read in hte item id HAMMERSTEEL.10 and then i'll asign the attributes in another table. for example:
if(itemId.matches `hammerregex`) {
// build an update statement in sql that will assign the appropriate values
}

if(itemId.matches `axeregex) {
//build an update statemet in sql that will assign appropriate axe values
}
if(itemId.matches `hammerregex`) {
// build an update statement in sql that will assign the appropriate values
}

if(itemId.matches `axeregex) {
//build an update statemet in sql that will assign appropriate axe values
}
I want to cut down on the amount of branching if statements. any suggestions?
30 replies
CC#
Created by mrdudebro1 on 10/12/2023 in #help
Working with jsonnode class
Working with JsonNode class. Is there any function or property to get the various key value pairs? Would jsonDocument be better? I have a string I got from an http request and I need to manipulate the data. One example of the json is below. all other entries are similar. Certain values omitted for security.
{
"LicenseUsageList": [
{
"UserName": "doman\\username",
"LicenseType": "license type",
"AcquisitionTime": "2023-10-12T08:04:52.523",
"SessionType": "UISERVER-FULL",
"SessionId": "session id",
"LicenseProperties": [
{
"Key": "DbServerPid",
"Value": "64"
},
{
"Key": "ProgramName",
"Value": "program name"
},
{
"Key": "DbExecutionContextId",
"Value": "0"
},
{
"Key": "Name",
"Value": "app name"
},
{
"Key": "LoginName",
"Value": "user name"
},
{
"Key": "LoginTime",
"Value": "10/12/2023 08:04:52"
},
{
"Key": "HostName",
"Value": "server name"
},
{
"Key": "HostPid",
"Value": "hostPid"
}
]
},
]
}
{
"LicenseUsageList": [
{
"UserName": "doman\\username",
"LicenseType": "license type",
"AcquisitionTime": "2023-10-12T08:04:52.523",
"SessionType": "UISERVER-FULL",
"SessionId": "session id",
"LicenseProperties": [
{
"Key": "DbServerPid",
"Value": "64"
},
{
"Key": "ProgramName",
"Value": "program name"
},
{
"Key": "DbExecutionContextId",
"Value": "0"
},
{
"Key": "Name",
"Value": "app name"
},
{
"Key": "LoginName",
"Value": "user name"
},
{
"Key": "LoginTime",
"Value": "10/12/2023 08:04:52"
},
{
"Key": "HostName",
"Value": "server name"
},
{
"Key": "HostPid",
"Value": "hostPid"
}
]
},
]
}
I'd like to access each node via the "UserName" property and find duplicate values
37 replies
CC#
Created by mrdudebro1 on 10/4/2023 in #help
Inheriting classes documentation
Hi all, I have documentation for HttpContent class here https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpcontent?view=net-7.0, but it's abstract and can't use it. How do I find the classes that inherit from HttpContent? Thanks.
4 replies