I have Two tables, MachineWiseMaterial (Fields: McMatID) and MaterialIssueRegister (Fields: McMatID, IssueDate, IssueTime, EMR). I want the last issue date, time and EMR for each McMatID. I can find the same for any individual McMatID using SELECT TOP 1 as follows. But when I’m trying to join both table…
Tag: sql
Combine the results of multiple queries into one table
I have a table that gets its entries populated through a form in MS Access 2013. I have attached an image of part of the table below. Using the StartTime entry, I created a query that displays all the transactions that occur between 8AM – 9AM, and another query to display all the transactions that occur…
Access 2013 Requesting Enter Parameter On Insert Query
I’ve got a list box that pulls tests from a database depending on the college any particular student is in. When the student selects a test, I simply want to pull a few values out of the List box for stat tracking purposes. When I run this query, it requests I enter a parameter value. Here is my code: O…
Access DoCmd.OpenReport Where condition issue
I’m trying to print a report, like a invoice. But I have an issue with the Cmd.OpenReport Function. I have a query for that invoice with a parameter. I join this query with a report. When I open the report, I have to type the ID of the invoice. That is OK. But I have to print this report with
Rails query comparing one col from table Payment and sum of table Transaction
There are Payment (id, total) and Transaction (payment_id, amount) table in our database (simplified for post). Payment’s id is in Transaction and they can be joined together if needed. Here is what …
Check if a string contains only number
I am trying to check if a string contains only valid number in the following format But it should reject anything that contains non-numbers including double dots. Here are some invalid formats I have done the following When seems to work except for the case where there is more than one dot in the string. How …
type conversion failure
I have a table that looks something like this: The empty fields can be null or an empty string, I’m not sure. I want to update the firstName field to be all the characters in the name field until the -, whether firstname was empty or not. It doesn’t matter what was in there before the update. I tr…
SQL select duplicate rows based on multiple columns
I have created a request that returns me IDs of rows having the same column value. For example : id | Value ______________ 1 | label1 2 | label1 3 | label1 4 | label2 5 | …
Can I generate a deployment script from a dacpac
I’ve got a .dacpac file that’s being called by MSBuild and published to a QA database for testing. This publish is failing and the error I’m getting back from them is a generic “an error has occurred” message. I was hoping I could generate the deployment script from the dacpac an…
Given any child in the hierarchy, fetch complete tree by INFORMIX hierarchical SQL
I need a little help with Informix hierarchical sql query. I have table with the following structure : I am able to run the following query successfully : which returns the exact hierarchy as specified in the table above. However, I am trying to achieve something different here. I am trying to get the same re…