ms-access

Sql Query with inner select [duplicate]

自古美人都是妖i 提交于 2019-12-27 02:37:16
问题 This question already has answers here : Sql query to create a calculated field (2 answers) Closed 5 years ago . I have this sql query: SELECT DISTINCT [Card NO], [User Name], ( SELECT MIN(DateTime) AS [Enter Time], MAX(DateTime) AS [Exit Time], MAX(DateTime) - MIN(DateTime) AS [Inside Hours] FROM ExcelData ) FROM ExcelData GROUP BY [Card NO], [User Name], DateTime Table Schema: CardNO | UserName | DateTime I tried to execute it but with no success. I says that it is an invalid query. Can

object reference not set to an instance of an object Inserting database sql array

那年仲夏 提交于 2019-12-26 06:04:33
问题 How can i insert array textbox in database?I have to save each newboxes in access and it should be in different row..It has an error object reference not set to an instance of an object when saving the data Public Class Form1 Dim boxes As New List(Of TextBox) Dim combo As New List(Of ComboBox) Private Sub Addbuttons(buttonCount As Integer) Dim newbox As TextBox Dim newcombo As ComboBox For i As Integer = 1 To buttonCount newbox = New TextBox newbox.Size = New Drawing.Size(575, 35) newbox

Access form checkbox AND OR statements

风流意气都作罢 提交于 2019-12-25 20:00:09
问题 Recently I started creating a form to filter the database by using checkboxes. I have the following data: Category Type Country Fruit Apple NL Fruit Apple SU Fruit Banana NL Fruit Banana DE Nuts Cashew NL Nuts Cashew US Nuts Almond UK Nuts Almond GR Now I build in my form the checkboxes for Fruit & Nuts, for Apple, Banana, Cashew & Almond and for NL, SU, DE, US, UK & GR. At this moment I use only the OR statement in my SQL script, which works well. But if the user would like to know for

Hide Controls in MS Access Based on Value Field

随声附和 提交于 2019-12-25 19:36:56
问题 I am trying to hide some controls in a form in MS Access. The idea is that a linked table has a type of question such as OpenResponse or OptionBox. Given this input I want to switch the type of input the user can input. Here is a sample of what I have: Private Sub QuestionType_AfterUpdate() Dim QType As String Set QType = Me.QuestionType.Value Select Case QType Case OpenResponse Forms("Survey").Controls(AnswerField).Visible = True Forms("Survey").Controls(OptionTitle).Visible = False Forms(

Hide Controls in MS Access Based on Value Field

依然范特西╮ 提交于 2019-12-25 19:36:06
问题 I am trying to hide some controls in a form in MS Access. The idea is that a linked table has a type of question such as OpenResponse or OptionBox. Given this input I want to switch the type of input the user can input. Here is a sample of what I have: Private Sub QuestionType_AfterUpdate() Dim QType As String Set QType = Me.QuestionType.Value Select Case QType Case OpenResponse Forms("Survey").Controls(AnswerField).Visible = True Forms("Survey").Controls(OptionTitle).Visible = False Forms(

ConcatRelated() in complex database - parsing problems

删除回忆录丶 提交于 2019-12-25 19:01:48
问题 I have been tasked with concatenating values in a multi-table query or report, respectively. I have found Allen Browne's ConcatRelated() function, which appears to be doing what I want it to. I just can't get it to work, however. I know there are lots of different posts on this topic on stackoverflow, but I have read close to 30 of them and none solved my problem really. For better understanding, the database looks similar to this: Picture of relationship graph. What I need to do is output

How do I convert this Access Query to mySQL query

家住魔仙堡 提交于 2019-12-25 19:00:42
问题 This question is continuation of the following question: How do I convert this Access Query to mySQL query? I want to represent the above in my code as follows: the Access SQL FROM statement is as below FROM qryvw_employees INNER JOIN ((Tbl_Clients INNER JOIN (Tbl_Assignments INNER JOIN Tbl_Tasks ON Tbl_Assignments.Assignment_ID = Tbl_Tasks.Assignment_ID) ON Tbl_Clients.PAN = Tbl_Assignments.PAN) INNER JOIN qryvw_subtasks ON Tbl_Tasks.TaskID = qryvw_subtasks.TaskID) ON qryvw_employees.ID =

Access abends after DoCmd.OpenReport

北慕城南 提交于 2019-12-25 18:48:10
问题 A report is called from VBA to receive returned records from an Access pass-through query. After the DoCmd completes the report's parameters are set in the report's appropriate label containers setting their .Caption property as required. Access fails intermittently during this process which leads me to believe that the report is not truly open to receive the parameters. Here's the VBA sub: Private Sub Report_Open(Cancel As Integer) Dim strFromDate As String Dim strToDate As String Dim strWC

Finding nearest date to today in Access 2013

北战南征 提交于 2019-12-25 18:48:07
问题 My query returns results similar to this. id date 510010 12/09/2013 510010 10/09/2013 510010 05/09/2013 510010 14/09/2013 510012 14/09/2013 510012 10/09/2013 Is there a way that I can make my query only select the date nearest todays date for each distinct id? Expected outcome. 510010 12/09/2013 510010 10/09/2013 510012 10/09/2013 Thanks, Chris 回答1: If you have a table named [YourTable] with the data... id date ------ ---------- 510010 2013-09-12 510010 2013-09-10 510010 2013-09-05 510010

Get rid of duplicate record and calculated field

不羁的心 提交于 2019-12-25 18:43:00
问题 The post is linked to the following Sum and Substract column in same table I’ve the following table "TableOfDelivery" in access 2016 Based on stackflow team member help, I worked out a query SELECT t1.ref, t1.[delivery week], (t2.qty-t1.qty) AS QtyDiff, iif(t1.[delivery week] <> t1.[delivery week],t1.qty *-1, t1.qty) AS Diff FROM TableOfDelivery AS t1 LEFT JOIN TableOfDelivery AS t2 ON (t1.[delivery week] = t2.[delivery week] AND (t1.[reporting week] <> t2.[reporting week])) AND (t1.ref = t2