Hello guys thanks for the replies,
@Dormilich - That's what I'm actually trying to do. But unfortunately, I cannot figure out how can I enclose each element of the array by quotes using implode. Please teach me how to do that. Sorry for being new to PHP functions.
@roshan ban - Are you suggesting to make a loop of SQL querries? I believe that it would only make the system slower?
User Profile
Collapse
-
multiple search
Hi! I'm trying to do a multiple search in my php code. I have an input text field where I input my wanted values then when I click the search button, An html table would show all my searched values from my database table.
For example, I want to search multiple names(mark, jake, john, michael) <-- this is typed in a single text field separated by commas.
Then it will go to another page which will show all records from... -
What happens when you run the query? Did you receive the same error? Or it runs successfully?Leave a comment:
-
Hello NeoPa!
Nevermind :D I figured to handle it by simply not showing records with NULL Date_Received in the query. :D Thanks so much again for the great help! :D You rock!Leave a comment:
-
THANKS NEOPA! IT WORKED! :D
"The other thing to check (as things seem to be coming together nicely) is that you check every record result carefully. Only one, hidden in there somewhere, which isn't either True or False will cause the query to fail."
The last record produced and error and I just deleted it. :D
However, How should I handle unreceived records? (records with no Date_Received) Can't I just...Leave a comment:
-
Hi NeoPa,
I have implemented the new Code for the module. And it was able to remove the #ERROR's when running the query. I believe that it automatically inputs the date today? Im not really sure. However, when I ran some tests on adding WHERE clauses on the querry:
Code:WHERE (Temp.Within)
Leave a comment:
-
I followed you instruction and removed my ByRef and added a parameter for the endDate as a Variant. I also already followed your code.
Here's my actual code now:
Code:Option Compare Database Option Explicit Public Function Workdays(ByVal startDate As Date, _ ByVal varEndDate As Variant, _ Optional ByRef strHolidays As String = "Holidays" _ ) As Integer
Leave a comment:
-
When I remove that WHERE clause, It successfully displays all records I want. Except it displays both TRUE and FALSE records. Records with NULL value for Date_Received displays #ERROR. I didn't see it as a problem before, since I know that there should be NULL values for Date_Received and the function just outputs #ERROR. And it still displays anyway.
Hmmmm. Anyway I belive you and following your expert advice, how could I fix my code...Leave a comment:
-
Hi NeoPa,
Hmmm..
1. False
2. False
3. False
4. True
Yes ofcourse some Records still don't have Date_Receive value. simply because in the process, the actual form is still not received. So these records would be NULL. However my problem is not with UC_Create_Date and Date_Received. I believe that the Data Type mismatch refers to when I add the WHERE clause "WHERE temp.Within =...Leave a comment:
-
Hi this is my new SQL code
Code:SELECT temp.Within FROM (SELECT ((Workdays([UC_Create_Date],[Date_Received])-1)<=7) AS Within FROM tbl) AS temp WHERE temp.Within = TRUE;
I still receive data type mismatch. :(
My expression for
Code:((Workdays([UC_Create_Date],[Date_Received])-1)<=7)
Leave a comment:
-
Hi guys! So here's the module/functions:
Code:Option Compare Database Option Explicit Public Function Workdays(ByRef startDate As Date, _ ByRef endDate As Date, _ Optional ByRef strHolidays As String = "Holidays" _ ) As Integer ' Returns the number of workdays between startDate ' and endDate inclusive. Workdays excludes weekends and
Leave a comment:
-
@NeoPa
Workingdays() is declared in a module. basically it computes the number of working days between a two dates. The function actually works. The return type of the function is a number which is the number of working days computed. The calculated field query is (If the working days between create_date and date received <=7 it will display true or Yes). I named that field "Within" which means it was received within 7...Leave a comment:
-
Hi guys!
@Mihail - I did both methods but I still get same error :(
@Taki - I already tried adding quotes but still same error :(
@NeoPa - Good point! :) but when I tried to add
Code:((Workdays([UC_Create_Date],[Date_Received]) - 1) <= 7)
Code:WHERE (((CSP.UC_Create_Date) Between [StartDate] And [EndDate]) AND ((([CSP].[UC_Create_Date])>=[StartDate])<[EndDate]+1))
Leave a comment:
-
But when I try to write the code, it gives me an error of:
"This expression is typed incorrectly, or its too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression parts of the expresion variables."
How could I get the variable of my calculated field? when I try [Within], it only prompts me to input a within parameter. :( but that...Leave a comment:
-
Criteria for a calculated field in a query
Hi!
I need help on what criteria should I put in order for my query to display records where Within(fieldnam e of the calculated field) = Yes (it's a Yes/No format)
This is my calculated field expression:
Code:Within: IIf((Workdays([UC_Create_Date],[Date_Received])-1)<=7,-1,0)
-
Haha. Good job. :)
Like I said, I'm also a newbie in VBA and just trying to help. Sorry for my syntax errors. :D Thanks to TheSmileyCoder for also teaching me. :)Leave a comment:
-
Hmmmm.
try this instead:
Code:currentdb.Execute ("ALTER TABLE table1 ADD COLUMN('" & me.ID.Value& "') Text;")
Leave a comment:
-
Hi,
Have you tried putting the value of the textbox in a string first before you execute your sql code?
something like this:
Code:Private Sub savebutton1_Click() mSaved = True Dim newColName As String Set newColName = Me.txtNewColName.Value CurrentDb.Execute ("ALTER TABLE table1 ADD COLUMN " & newColName & "TEXT(50)") MsgBox "Saved!"
Leave a comment:
-
-
@NeoPa
I did what you suggested and it's now working pefectly. :D
Thank you so much for correcting me and explaining how it should be done. :D More power to expert programmers like you! :D
Code:Private Sub btnFilter_Click() Dim strFilter As String With Me If .txtFindCardNumber > "" Then strFilter = Replace(.txtFindCardNumber,
Leave a comment:
No activity results to display
Show More
Leave a comment: