In Microsoft Access, I made a simple query with criteria to list all entries in a table between two dates. It was working well for more than a year, but now I think I am facing a bug… Between #2022-11-29# And #2023-01-26# causes a bug that corrupts the database and then I get the error message: Unrecognized database format Between
Tag: database
SQL CASE WHEN Logic does not work for comparison to NOW() date
I am using Apache Phoenix Query Server. I need to manipulate the payment_status column so that it follows the logic below and be corrected. However, I noticed that even when paid_date is equal to now_date, the converted status (new_payment_status) becomes “Overdue” instead of “Due”. Any ideas why was that happening? Result and Metadata: Edit: Embeded a screenshot instead, because markdown
MySQL – Show the restaurant name and items where price is over a certain value
I have two tables: I am trying to get the restaurnat name, item name and price where all the restaurants’ items have a price higher than 10. Examaple result: restaurant item price The King Fry item 1 12.30 THe King Fry item 2 13.00 The King Fry item 3 10.60 All the items listed on their menu are > 10
How to return rows containing decimals in a range
I have the following table: Rows Decimals First 1.1.1.3.2 Second 16.1.1.1.89.1 Third 3.1.1.1.177.2 Fourth 1.1.1.1.178.3 I only want to return the rows where the second to last decimal is between 0.7 to 0.94 (inclusive), but all the other numbers can contain any value. For the above table, this would be only the second row. How can I specify my query
SQL query to extract matching diagonal pairs in SQL Server database
I have a database table (mytable) with 2 columns x and y as shown below, from which I intend to extract rows with matching diagonal pairs of (x,y) and (y,x) e.g., 4 21 and 21 4 I have tried the accepted code on stackoverflow here (enter link description here) on my mytable which gives me the expected results on Oracle
How to make an dynamic SQL SELECT query by passing in a comma separated list of values?
I have a column in my SQL database (using mySQL) ‘lastname’, which has any number of employee’s last names in it. I want to write a query that handles a search for last names using a comma delimited list. So the user will type: And that gets stored in a String, lastNameQuery, which then gets passed into my backend API
SQL how to create a view with 2 sums of diferent tables, when those tables have diferent number of rows
I have 3 tables, “accounts” “charges” and “payments” I want to create a view with the account data the sum of the charges, and the sum of the payments, but payments have usually more records than charges for the same account when I create the view and GROUP BY charges end up “duplicated” like by the number of rows mismatch.
DB2 leading zeroes [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month. Improve this question How to trim only zeroes in a leading position in a string? I’m writing a DB2 script that removes all leading zeroes from a string that
Copy data on parent and child table
I have two database tables. What I need to do is to copy specific data from one storage to another, but also keep the mapping to the photos. First part I can do easily writing but after that newly inserted items does not have photos. Note, that document_id field is unique for not copied items. Answer Assuming id columns are
list records which do not meet a certain criteria in Oracle SQL
I got 3 tables please see the below. Currently, a car has a unique tag assigned to them. I have employees with multiple roles. There are only 3 roles. 1 = Surveyor, 2 = Admin or 3 = Engineer. A car can be assigned to more than one employee. One car can have a surveyor, admin and engineer using it.