Databases

54K

Solutions

38K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

Share tech news, updates, or what's on your mind.

Sign up to Post

Struggling a bit with a query. Here's the details:

Table1

ID, StartDate, EndDate, Approval (Bool/bit), Hours (Decimal 5/2), FiscalYear, EMPLID


Table2

ID, EmployeeCode, FirstName, LastName, Mgr



I need to display T2.FisrtName, T2.LastName, T2.Mgr, T1.StartDate, T1.EndDate, T1.FiscalYear, And the sum of T1.Hours
WHERE T1.EMPLID = T2.EmployeeCode

So basically I'm looking to display 1 record for each record in T2 while displaying the sum of T1.Hours for each correlating T1.EMPLID/T2.EmployeeCode record(s)


Result might look something like:


Peter     Griffin     Glenn Quagmire     1/1/2000     1/6/2000     1999     84.5



How would I do this?
0
On Demand Webinar: Networking for the Cloud Era
LVL 9
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Hi
I have a simple database that contains a couple of tables, queries. macros and modules etc.. I'm trying to make it more users friendly, so I have designed a form that loads up and will give the user the option to select an option button then the macro will run and create the report. However what I want the form  to do is to remember the last option button that was selected when the form re-opens.

Thanks
0
Hi. I am running the following event procedure which worked in another part of my database but is now returning a value of "-1" to my field in this case "ProjectTitle" which is a text field. My code is below:
 

Private Sub ProjectTitle_AfterUpdate()

    Me!ProjectTitle = True
    DoCmd.RunCommand acCmdSaveRecord
        
    Dim strProjectTitle As String
    strProjectTitle = Me.ProjectTitle
    Me.Requery
    With Me.RecordsetClone
        .FindFirst "ProjectTitle = " & Chr(34) & strProjectTitle & Chr(34)
        Me.Bookmark = .Bookmark
    
    End With
    
  

End Sub

Open in new window


Anybody know why?
0
An oldie, but a goodie.

I have created a large Relationship Diagram in Access 2013 and I do have a Cannon iPF8400 Plotter. I have set the page size to 18 x 24 C, which shows the relationship on one page; however the report will not print, as the plotter errors out. If I go into Report Design View the paper size has been truncated to 12.5 x 19.5 and the Diagram Window has been adjusted to fit to that size.

I have read this thread, Lebans and Allen Brown are no longer available.

So what are my options?
0
I have exchange 2010 STD with few Databases. I create new database and move all mailbox from one of the older Database to a new one.
Dismounted old database but can't remove it. Error message says there is either a mailbox, or archive or an arbitration on it.
I do see 3 items under arbitration
do I need them? DB is dismounted for a couple of weeks. how to I move or remove such item
please see screenshot attached.
is it related to mailbox indexes?
0
A MySQL  database has three  levels of subtable.
project->snapshot->layer  

Need to duplicate a project record along with all subrecords from snapshot and layer
a project can have many snapshots, a snapshot can have many layers

Would prefer to do this in PHP but stored procedure is OK
All comments and advice welcome and appreciated
0
Is it possible to view an MS-SQL Server last 10 queries on a specific database or table?  and how?  (I'm using MS-SQL Server Express 2016).

I've seen this code on SO but it doesn't show every calls, and not for a long time.  If i run the same query again, some rows of the previous result doesn't show anymore:
SELECT deqs.last_execution_time AS [Time], dest.text AS [Query], dest.*
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
WHERE dest.dbid = DB_ID('MyDB')
ORDER BY deqs.last_execution_time DESC

Open in new window


Do i have to set a flag to keep a trace somewhere?

Thanks you
0
Hi Experts,

I have a page which has a Ajax call to a search function, which is working fine with the search button, which calls it. When I added a function to capture the enter key to trigger the click attribute of the search button, now the the function is firing, pulls back the correct search records for a flash, but then the page completely reloads with the original value of the page. What I'm not understanding is how the default value of the page is loading, since it's not hitting the database call again. Any ideas?

Thanks,
Steve
0
I have one table that I cannot edit through Sql Server Management Studio.  It is being used with Sql Server 2008 R2.  I get Unspecified error MS Visual Database Tools.  Searching the web has not given me any solutions.  Can someone out there help with this?

Sql Version is 10.50.6220.0.

Microsoft SQL Server Management Studio                                    10.50.6000.34
Microsoft Analysis Services Client Tools                                    10.50.6000.34
Microsoft Data Access Components (MDAC)                                    6.1.7601.17514
Microsoft MSXML                                    3.0 4.0 5.0 6.0
Microsoft Internet Explorer                                    9.11.9600.18697
Microsoft .NET Framework                                    2.0.50727.8669
Operating System                                    6.1.7601
0
I have a schema (database) in MSSQL that is called PRODUCTION.  I also have security group setup in Active Directory called DB_USERS.  

I am having a problem with the syntax to grant the security group, (and all of the members of it), the rights of SELECT, INSERT, UPDATE, ALTER and DELETE to "all" of the tables inside of this DB.

Can someone provide me with a syntax SQL query command to do that, or alternatively, how I can do that through SSMS?   For some reason I am just not getting the syntax correct.

I tried the following script, and it creates everything, but it errors out on the last line when it comes to the GRANT command.

USE master;
GO
CREATE LOGIN [MYCOMPANY\DB_USERS] FROM WINDOWS;
GO
USE PRODUCTION;
GO
CREATE USER [MYCOMPANY\DB_USERS] FROM LOGIN [MYCOMPANY\DB_USERS];
GO
CREATE ROLE DBACCESS;
GO
EXEC sp_addrolemember 'DBACCESS', 'MYCOMPANY\DB_USERS';
GO
GRANT SELECT, INSERT,UPDATE,ALTER,DELETE ON SCHEMA::PRODUCTION TO DBACCESS;
GO

The error I am getting is "unable to access schema PRODUCTION. It does not exist or you do not have permissions."

I am logged in as SA.

Thank you in advance,
Jeff
0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

I'm trying to figure out what the correct way is to modify a date format before inserting when using Laravel 5.4.

I have:
public function store(){

        $trip = new Trip;
        $trip->tripName = request('tripName');
        $trip->departing = request('departing');
        $trip->returning = request('returning');
        $trip->save();

        return $trip;

        //return redirect('/home');
    }

Open in new window


My database mySQL field in datetime, but the date that's passed in the variable is '07/17/2017 3:20 PM'.  How/where would I update that before insertion?
0
I have a complex query that runs fine but now they want another field from another table - the problem is it should just be returning 900 records but when the additional table is added I get thousands.  Here is the original.

SELECT     h.HospitalName, 'S' AS StaffType, lup.ProcedureName, lupg.ProcedureGroupName, lus.Service, lus.ShortService, lus.FlagPrimary, p.DateSurgery, p.CaseOrder, 
                      p.Room, p.Urgency, CONVERT(VARCHAR(25), p.estStartTime, 101) AS EstStartTime, CONVERT(VARCHAR(25), p.InRoomTime, 101) AS InRoomTime, 
                      CONVERT(VARCHAR(25), p.OutRoomTime, 101) AS OutRoomTime, p.Cancelled, p.FlagCaseStage, CONVERT(VARCHAR(25), p.ASAClass) 
                      + CASE ASAE WHEN 1 THEN 'e' ELSE '' END AS ASAClass, rp.Notes, s.MEPERSCode, lud.MEPRSUnitID, lud.Facility5DigitZIPCode, h.SiteID
FROM         tbl_Patient AS p INNER JOIN
                      tbl_RoomProp AS rp ON rp.SiteID = p.SiteID AND rp.Room = p.Room INNER JOIN
                      tbl_LUHospital AS h ON h.SiteID = rp.SiteID AND h.LUHospitalID = rp.LUHospitalID INNER JOIN
                      tbl_Service AS s ON s.SiteID = p.SiteID AND s.PatientID = p.PatientID INNER JOIN
                      tbl_LUService AS lus ON lus.SiteID = s.SiteID AND lus.LUServiceID = s.LUServiceID INNER JOIN
                      tbl_ORProc AS o ON o.SiteID = s.SiteID AND o.ServiceID = s.ServiceID INNER JOIN
                      tbl_LUProcedure AS lup ON lup.SiteID = o.SiteID AND 

Open in new window

0
Can the database password on the SAP Crystal Reports in SAP Business Objects Enterprise be updated using an API?

Is there an API .NET Framework available?

Where can the API be downloaded?

Does the API have to be installed on the both the client and server?
0
I understand the exposure of having a public facing website with username root.

So, I have created a new username and changed my WordPress site to use that new username.

Shall I delete the "root" username?

Thanks.
1
I have create Database in my Localhost in mysql Server by phpmyadmin. where i have define no any privileges for the database. when i made live this db on the Hostech Server provider phpmyadmin al tables where successfully imported and  in the Case of views it is showing  me the following error.
"#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation".

This is the example of the views query that i have to upload on my live DB server from my local server .
"CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `crqry_bomoils`  AS  select
`qry_bom`.`FormulaID` AS `FormulaID`,`qry_bom`.`Code` AS `Code`,`qry_bom`.`MaxOfRevision` AS `MaxOfRevision`,`qry_bom`.`Revision` AS
`Revision`,`qry_bom`.`FormulaName` AS `FormulaName`,`qry_bom`.`Group` AS `Group`,`qry_bom`.`FragranceID` AS
`FragranceID`,`qry_bom`.`Qty` AS `Qty`,`qry_bom`.`FragranceName` AS `FragranceName`,`qry_bom`.`Flag` AS `Flag`,`qry_bom`.`CAS1` AS
`CAS1` from `qry_bom` where (`qry_bom`.`Group` = 'ESSENTIAL OIL') order by `qry_bom`.`FragranceName` ".

1:Main Question is that how can i make live my database with my views that i have created on my Localhost server.??
2:How can i import my  database with views  from my localhost server that should be import on any other mysql server without any privileges errors ??

Thanks In Advance!
0
Hi! I'm having some trouble with some code I am trying to put together. I am very much a beginner, so this could be a really simple problem. Basically, I have a subform that uses information from the parent form and and another subform to create an email. I am not having any issues generating the email, but what I want to do is create body text using a text field in the subform only if a related field is "true" (it's a yes no field).  Right now I have

  l_Msg.HTMLBody = "<!DOCTYPE html><body style=""font:normal normal normal 11pt/11pt calibri;"">" & _
  "<div>Hi" & " " & Me!PitchCastingFirstName & "!<br><br>" & _
  "I'd like to submit" & " " & UCase((Parent!FirstName) & " " & Nz(Parent!LastName)) & " for the role of " & Nz(Me!PitchRole) & "." & _
  " " & Parent!ClientPitchParagraphTbl_subform.Form!PitchParagraph & _
  "</div></body></html>" _

Open in new window


I want Parent!ClientPitchParagraphTbl_subform.Form!PitchParagraph to only be used if the related field "active" is set to "true".  Do I have to create a string or is there a simple declaration?

Thanks in advance.
0
My Disk and PC performance is very good. Until I start the mssqlserver.  Even if I am not have any queries on databases. As if some activity was left from a previos query (like a rollback that didnt finish) how can I fi this?

Any Ideas?
0
when run the below

EXEC sp_RestoreFromAllFilesInDirectory 'C:\backup\', 'C:\Data\',  'C:\Data\'

please see error please help

Msg 213, Level 16, State 7, Line 1
Column name or number of supplied values does not match table definition.
Msg 3013, Level 16, State 1, Line 1
RESTORE HEADERONLY is terminating abnormally.
 
Msg 213, Level 16, State 7, Line 1
Column name or number of supplied values does not match table definition.
Msg 3013, Level 16, State 1, Line 1
RESTORE HEADERONLY is terminating abnormally.
0
So have 2 different SQL servers, One has a financial database (GP) I need to be able to run a script nightly that takes data from field in a table and copys to the other database.  Basically it would look for data in one field and find the data that needs copied in another field and copy that to the same matching in another database.  Is this something that can be done with a stored procedure?
0
Free Tool: Site Down Detector
LVL 9
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hello,
  I have a profile update page that is displaying the changes after the update button is clicked but it is not updating the actual table data. Here is what I have
if(isset($_POST['Update'])) {
	mysql_connect('xxxxxx', 'xxx', 'xxx') or
    die("Could not connect: " . mysql_error());
	mysql_select_db("xxx");
	
	if(!empty($_POST[FirstName]))  {
    $first_name = $_POST['FirstName'];
}
if(!empty($_POST[LastName]))  {
    $last_name = mysql_real_escape_string($_POST['LastName']);
}
if(!empty($_POST[Email]))  {
    $email = mysql_real_escape_string($_POST['Email']);
}
if(!empty($_POST[Password]))  {
    $password = mysql_real_escape_string($_POST['Password']);
}
if(!empty($_POST[Add1]))  {
    $address_1 = mysql_real_escape_string($_POST['Add1']);
}
if(!empty($_POST[Add2]))  {
    $address_2 = mysql_real_escape_string($_POST['Add2']);
}
if(!empty($_POST[City]))  {
    $city = mysql_real_escape_string($_POST['City']);
}
if(!empty($_POST[County]))  {
    $county = mysql_real_escape_string($_POST['County']);
}
if(!empty($_POST[State]))  {
    $state = mysql_real_escape_string($_POST['State']);
}
if(!empty($_POST[Zip]))  {
    $zip_code = mysql_real_escape_string($_POST['Zip']);
}
if(!empty($_POST[PhoneNumber]))  {
    $phone_num = mysql_real_escape_string($_POST['PhoneNumber']);
}
	$sql = "UPDATE 'users' SET 
       FName = '.$first_name.', 
       LName = '.$last_name.', 
       Email = '.$email.', 
       city = '.$city.', 
       state = '.$state.',
	   Zip = 

Open in new window

0
Hello everybody, I'm a beginner of VB.net and I face this problem ....
how data grid view on click display a data of another table that doesn't link to it..the 2 pictures indicate the problem obviously.
i'm using MS Access 2013 as a database
thanks in advance.................................
2.png
3.png
0
Experts,

I have a two-tier access database with a timesheet entry form with a subform that shows all timesheets already submitted for the current Emp.

The sub form Data Source is the sql query below, but this setup keeps the back end open while the form is open on any client
TRANSFORM Sum(tbl_TS_Hours.Hours) AS SumOfHours
SELECT tbl_TS_Hours.ConsultantID, tbl_TS_Hours.WeekEnding
FROM tbl_MasterLocal INNER JOIN tbl_TS_Hours ON tbl_MasterLocal.[wContractor ID] = tbl_TS_Hours.ConsultantID
GROUP BY tbl_TS_Hours.ConsultantID, tbl_TS_Hours.WeekEnding
PIVOT Format([WorkDt],"ddd");

Open in new window


I'd prefer to have the sub form unbound, and when a user submits a new timesheet (cmd button), requery the subform to show the new timesheet added to the query.

I have the Access 2010 VBA Programmer's reference...I just need help with what method to use. Would I use VBA to execute the above sql query with DoCmd.RunSql, object.execute, or use a Recordset object?

Thanks
0
Hi

I have built and manage a SQL database in Microsoft Azure.  Mining data is loaded to this from several sites around the country.
One of the mines now want to be able to read the data at the end of each day.
I have never done this before so am not sure whether a data push from our side or a data pull from their side is best.
The SQL data includes other mines so we don't want to give them access to all our data.

What is the best way to handle this?

Thanks
0
Hey everyone I have a problem with my query
Iwant to realise a query that at gives the maximum of the defects  in my database and displays the 3 top values in another table.

PS i developpe with delphi 7 and my database  with paradox 9.
help plz
0
I had this question after viewing Access 2010 Open Form Based On Multiple Criteria When Double Clicking Field.

Where clause with two criteria, a text field and a date field, where the date field is blank

DoCmd.OpenForm "frmEmployees", , , "eJobTitle Not Like( '*Director*')" And "EdateLeft #Is Null#"

I keep getting Run time error 13 Type Mismatch

However I try to refer to the eDateLeft field I get the same error
0

Databases

54K

Solutions

38K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.